From 3894db0824bbb0023bce8402f1c4f578504fb8ce Mon Sep 17 00:00:00 2001 From: Geo Halkiadakis Date: Mon, 15 Apr 2024 18:41:27 +0300 Subject: refactoring routes; added weighted exact and partial match routines --- app.js | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'app.js') diff --git a/app.js b/app.js index aa79f62..c0392e6 100644 --- a/app.js +++ b/app.js @@ -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); -- cgit v1.2.3