summaryrefslogtreecommitdiff
path: root/app.js
diff options
context:
space:
mode:
authorGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2024-04-09 01:39:07 +0300
committerGeorge Halkiadakis <gchalkiadakis@sklavenitis.co.gr>2024-04-09 01:39:07 +0300
commitf52ea6691ad26aac0a5b4b4f6e292492a8f2a2da (patch)
treed10488153c162a3ec6b222b76f3f6182ce8d7cf6 /app.js
downloadoseine-f52ea6691ad26aac0a5b4b4f6e292492a8f2a2da.tar.gz
oseine-f52ea6691ad26aac0a5b4b4f6e292492a8f2a2da.tar.bz2
oseine-f52ea6691ad26aac0a5b4b4f6e292492a8f2a2da.zip
basic node.js+koa rest api installation
Diffstat (limited to 'app.js')
-rw-r--r--app.js16
1 files changed, 16 insertions, 0 deletions
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);