diff options
| author | Geo Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2024-04-15 18:41:27 +0300 |
|---|---|---|
| committer | Geo Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2024-04-15 18:41:27 +0300 |
| commit | 3894db0824bbb0023bce8402f1c4f578504fb8ce (patch) | |
| tree | d74e86ea41fb83ede379429e7b9bc3e4408f96ba /app.js | |
| parent | b122279ece06a9381e805c6087f130b41616fe3d (diff) | |
| download | oseine-3894db0824bbb0023bce8402f1c4f578504fb8ce.tar.gz oseine-3894db0824bbb0023bce8402f1c4f578504fb8ce.tar.bz2 oseine-3894db0824bbb0023bce8402f1c4f578504fb8ce.zip | |
refactoring routes; added weighted exact and partial match routines
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); |
