koa-66-aggregate
v0.2.0
Published
aggregate koa-66 router from directory
Maintainers
Readme
koa-66-aggregate
Aggregate koa-66 Router from directories.
Installation
npm install koa-66-aggregateOptions
path: path of routes directoriesuseFiles: use all file as auto prefix (default: false)autoPrefix: add dir/file as prefix (default: true)plugins: object of plugins available on each router instanceglobs: default : ['**/index.js']
Example
routes/
index.js
v1/
index.jsEach index.js exports an instance of koa-66
const aggregate = require('koa-66-aggregate');
const router = aggregate({path: './routes'});It's use mount() methods of koa-66, prefixed by the name of the directory.
So all routes contans on v1/index.js will be prefixed by /v1
