correct resource paths
This commit is contained in:
parent
c78b14a68a
commit
678b48beec
|
@ -3,7 +3,7 @@ const couchdb = require("../../db");
|
|||
const controller = {
|
||||
create: async ctx => {
|
||||
const clientDatabase = couchdb.db.use(ctx.params.clientId);
|
||||
ctx.body = await clientDatabase.create(ctx.request.body.appname);
|
||||
ctx.body = await clientDatabase.insert(ctx.request.body);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
const couchdb = require("../../db");
|
||||
|
||||
const controller = {
|
||||
forgotPassword: async ctx => {
|
||||
|
||||
},
|
||||
setPassword: async ctx => {
|
||||
|
||||
},
|
||||
changePassword: async ctx => {
|
||||
|
||||
},
|
||||
authenticate: async ctx => {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = controller;
|
|
@ -0,0 +1,9 @@
|
|||
const Router = require("@koa/router");
|
||||
const controller = require("../../controllers/auth");
|
||||
|
||||
const router = Router();
|
||||
|
||||
router
|
||||
.post("/api/authenticate", controller.authenticate);
|
||||
|
||||
module.exports = router;
|
|
@ -4,30 +4,8 @@ const controller = require("../../controllers/record");
|
|||
const router = Router();
|
||||
|
||||
router
|
||||
.get("/api/records/:databaseId", controller.fetch)
|
||||
.post("/api/records/:databaseId", controller.save)
|
||||
.delete("/api/records/:databaseId/:recordId", controller.destroy)
|
||||
|
||||
// router.post(
|
||||
// "/_builder/instance/:appname/:instanceid/api/record/*",
|
||||
// routeHandlers.saveRecord
|
||||
// )
|
||||
|
||||
// router.get("/:appname/api/listRecords/*", () => {
|
||||
// ctx.body = await ctx.instance.indexApi.listItems(indexkey)
|
||||
// ctx.response.status = StatusCodes.OK
|
||||
// })
|
||||
|
||||
// router.get(
|
||||
// "/_builder/instance/:appname/:instanceid/api/listRecords/*",
|
||||
// routeHandlers.listRecordsGet
|
||||
// )
|
||||
|
||||
// router.post("/:appname/api/listRecords/*", routeHandlers.listRecordsPost)
|
||||
|
||||
// router.post(
|
||||
// "/_builder/instance/:appname/:instanceid/api/listRecords/*",
|
||||
// routeHandlers.listRecordsPost
|
||||
// )
|
||||
.get("/api/:databaseId/records", controller.fetch)
|
||||
.post("/api/:databaseId/records", controller.save)
|
||||
.delete("/api/:databaseId/records/:recordId", controller.destroy)
|
||||
|
||||
module.exports = router;
|
|
@ -4,6 +4,10 @@ const controller = require("../../controllers/schema");
|
|||
const router = Router();
|
||||
|
||||
router
|
||||
.get("/api/schemas/:appId", controller.fetch)
|
||||
.post("/api/schemas/:appId", controller.save)
|
||||
.delete("/api/schemas/:appId", controller.delete)
|
||||
.get("/api/:clientId/:appId/schemas", controller.fetch)
|
||||
.post("/api/:clientId/:appId/schemas", controller.save)
|
||||
.patch("/api/:clientId/:appId/schemas/apply", controller.apply)
|
||||
.delete("/api/:clientId/:appId/schemas/:schemaId", controller.delete)
|
||||
|
||||
|
||||
module.exports = router;
|
Loading…
Reference in New Issue