diff options
Diffstat (limited to 'app.js')
| -rw-r--r-- | app.js | 17 |
1 files changed, 8 insertions, 9 deletions
@@ -1,19 +1,18 @@ // app.js -const Koa = require('koa'); -const { koaBody } = require('koa-body'); +const Koa = require('koa'); +// const { koaBody } = require('koa-body'); require('dotenv').config(); +// define app const app = new Koa(); // middleware -app.use(koaBody()); - -// Require the routers -let paths = require('./paths.js'); +// app.use(koaBody()); -// use the routes -app.use(paths.routes()); +// Require routes +let _r = require('./routes'); +app.use(_r.routes()).use(_r.allowedMethods()); -// app.listen(3000); +// start server listening on APP_PORT app.listen(process.env.APP_PORT); |
