@micro-cms/resource-module 1.0.3 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -41,7 +41,7 @@ var createResourceModule = () => {
41
41
  // Introspection
42
42
  {
43
43
  method: "GET",
44
- path: "/api/schema",
44
+ path: "/schema",
45
45
  handler: async (req, res) => {
46
46
  const schema = await db.introspect();
47
47
  res.json(schema);
@@ -51,7 +51,7 @@ var createResourceModule = () => {
51
51
  // Generic List
52
52
  {
53
53
  method: "GET",
54
- path: "/api/resources/:resource",
54
+ path: "/resources/:resource",
55
55
  handler: async (req, res) => {
56
56
  const { resource } = req.params;
57
57
  const { page, limit, sort, ...filter } = req.query;
@@ -68,7 +68,7 @@ var createResourceModule = () => {
68
68
  // Generic Get One
69
69
  {
70
70
  method: "GET",
71
- path: "/api/resources/:resource/:id",
71
+ path: "/resources/:resource/:id",
72
72
  handler: async (req, res) => {
73
73
  const { resource, id } = req.params;
74
74
  const item = await db.findById(resource, id);
@@ -80,7 +80,7 @@ var createResourceModule = () => {
80
80
  // Generic Create
81
81
  {
82
82
  method: "POST",
83
- path: "/api/resources/:resource",
83
+ path: "/resources/:resource",
84
84
  handler: async (req, res) => {
85
85
  const { resource } = req.params;
86
86
  const item = await db.create(resource, req.body);
package/dist/index.mjs CHANGED
@@ -17,7 +17,7 @@ var createResourceModule = () => {
17
17
  // Introspection
18
18
  {
19
19
  method: "GET",
20
- path: "/api/schema",
20
+ path: "/schema",
21
21
  handler: async (req, res) => {
22
22
  const schema = await db.introspect();
23
23
  res.json(schema);
@@ -27,7 +27,7 @@ var createResourceModule = () => {
27
27
  // Generic List
28
28
  {
29
29
  method: "GET",
30
- path: "/api/resources/:resource",
30
+ path: "/resources/:resource",
31
31
  handler: async (req, res) => {
32
32
  const { resource } = req.params;
33
33
  const { page, limit, sort, ...filter } = req.query;
@@ -44,7 +44,7 @@ var createResourceModule = () => {
44
44
  // Generic Get One
45
45
  {
46
46
  method: "GET",
47
- path: "/api/resources/:resource/:id",
47
+ path: "/resources/:resource/:id",
48
48
  handler: async (req, res) => {
49
49
  const { resource, id } = req.params;
50
50
  const item = await db.findById(resource, id);
@@ -56,7 +56,7 @@ var createResourceModule = () => {
56
56
  // Generic Create
57
57
  {
58
58
  method: "POST",
59
- path: "/api/resources/:resource",
59
+ path: "/resources/:resource",
60
60
  handler: async (req, res) => {
61
61
  const { resource } = req.params;
62
62
  const item = await db.create(resource, req.body);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micro-cms/resource-module",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "Standardized CRUD and Schema routes for Micro-CMS",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -20,7 +20,7 @@ export const createResourceModule = (): CmsModule => {
20
20
  // Introspection
21
21
  {
22
22
  method: 'GET',
23
- path: '/api/schema',
23
+ path: '/schema',
24
24
  handler: async (req, res) => {
25
25
  const schema = await db.introspect();
26
26
  res.json(schema);
@@ -30,7 +30,7 @@ export const createResourceModule = (): CmsModule => {
30
30
  // Generic List
31
31
  {
32
32
  method: 'GET',
33
- path: '/api/resources/:resource',
33
+ path: '/resources/:resource',
34
34
  handler: async (req, res) => {
35
35
  const { resource } = req.params;
36
36
  const { page, limit, sort, ...filter } = req.query;
@@ -47,7 +47,7 @@ export const createResourceModule = (): CmsModule => {
47
47
  // Generic Get One
48
48
  {
49
49
  method: 'GET',
50
- path: '/api/resources/:resource/:id',
50
+ path: '/resources/:resource/:id',
51
51
  handler: async (req, res) => {
52
52
  const { resource, id } = req.params;
53
53
  const item = await db.findById(resource, id);
@@ -59,7 +59,7 @@ export const createResourceModule = (): CmsModule => {
59
59
  // Generic Create
60
60
  {
61
61
  method: 'POST',
62
- path: '/api/resources/:resource',
62
+ path: '/resources/:resource',
63
63
  handler: async (req, res) => {
64
64
  const { resource } = req.params;
65
65
  const item = await db.create(resource, req.body);