Sails.js like routing for koa.js
$ npm i impress-router-table --save
const routing = require('impress-router-table');
returns a koa middleware
const app = new (require('koa'))
app.use(routing(__dirname + '/api'))
app.listen(9000)
router must support get
/ post
/ etc HTTP methods
defaults to an new impress-router instance
for example in previous example, __dirname + '/api'
,
take a look at test/demo/api/
test/demo/api
βββ controllers
βΒ Β βββ PolicyTestController.js
βΒ Β βββ RouteTestController.js
βββ policies
βΒ Β βββ auth.js
βΒ Β βββ bar.js
βββ policy.js # policy config
βββ routes.js # routes config
2 directories, 6 files
the MIT License http://magicdawn.mit-license.org