diff options
| author | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2024-04-09 01:39:07 +0300 |
|---|---|---|
| committer | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2024-04-09 01:39:07 +0300 |
| commit | f52ea6691ad26aac0a5b4b4f6e292492a8f2a2da (patch) | |
| tree | d10488153c162a3ec6b222b76f3f6182ce8d7cf6 /app.js | |
| download | oseine-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.js | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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); |
