koa-enrouten
Route configuration middleware for koajs.
Installation
$ npm install koa-enrouten
API
app.use(enrouten(options))
var koa = ;var enrouten = ;var app = ; app; app;
directory
The directory
configuration option (optional) is the path to a directory.
Specify a directory to have enrouten scan all files recursively to find files
that match the controller-spec API. With this API, the directory structure
dictates the paths at which handlers will be mounted.
controllers |-user |-create.js |-list.js |-product |-index.js
// create.jsmodule{ router; return router;};
app;
Routes are now:
/user/create/user/list/product
Tests
npm test