File/Folder as path
, another router middleware for koa.
$ npm install koa-grace-router --save
router(app, options)
- app: {Object} koa instance.
- options: {Object|String->root}
- root: {String} router directory
File tree
├── app.js
└── controller
├── deal
│ ├── index.js
│ └── refund.js
├── index.js
└── test.js
app.js
var koa = require('koa');
var router = require('koa-grace-router');
app.use(router(app, {
root: './example/controller'
}));
app.listen(3000);
npm test
MIT