budibase/packages/server/app.js

16 lines
441 B
JavaScript
Raw Normal View History

2019-06-14 11:05:46 +02:00
const Koa = require('koa');
const app = new Koa();
const getMasterAppInternal = require("./utilities/masterAppInternal");
const router = require("./middleware/routers");
const bodyParser = require('koa-bodyparser');
module.exports = async (config) => {
app.keys = config.keys;
app.context.master = await getMasterAppInternal(config);
app.use(router(config, app).routes);
app.use(bodyParser());
return app.listen();
};