budibase/packages/server/middleware/controllers/application.js

10 lines
246 B
JavaScript
Raw Normal View History

2020-04-07 18:25:09 +02:00
const couchdb = require("../../db");
const controller = {
create: async ctx => {
2020-04-07 18:41:57 +02:00
const clientDatabase = couchdb.db.use(ctx.params.clientId);
2020-04-07 21:34:21 +02:00
ctx.body = await clientDatabase.insert(ctx.request.body);
2020-04-07 18:25:09 +02:00
}
}
module.exports = controller;