From f52ea6691ad26aac0a5b4b4f6e292492a8f2a2da Mon Sep 17 00:00:00 2001 From: George Halkiadakis Date: Tue, 9 Apr 2024 01:39:07 +0300 Subject: basic node.js+koa rest api installation --- app.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 app.js (limited to 'app.js') diff --git a/app.js b/app.js new file mode 100644 index 0000000..c0ad4f2 --- /dev/null +++ b/app.js @@ -0,0 +1,16 @@ +// app.js +const Koa = require('koa'); +const { koaBody } = require('koa-body'); + +const app = new Koa(); + +// middleware +app.use(koaBody()); + +// Require the routers +let paths = require('./paths.js'); + +// use the routes +app.use(paths.routes()); + +app.listen(3000); -- cgit v1.2.3