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

12 lines
293 B
JavaScript
Raw Normal View History

2020-04-07 16:12:08 +02:00
const couchdb = require("../../db");
const controller = {
create: async ctx => {
ctx.body = await couchdb.db.create(ctx.request.body.databaseName);
},
destroy: async ctx => {
ctx.body = await couchdb.db.destroy(ctx.request.body.databaseName)
}
}
module.exports = controller;