1.0.0 • Published 8 years ago
koa2-event-router v1.0.0
koa2-router-event
Usage
const Koa = require('koa');
const eventRouter = require('../lib');
const app = new Koa();
app.use(eventRouter({
path: `${__dirname}/src`,
filename: /\.controller\.js$/,
}));
app.listen(9999);Config
| Name | Type | Require | Default | Description |
|---|---|---|---|---|
| path | String | true | null | scanning entrance |
| filename | RegExp | false | /\.(js|ts)$/ | controller file matching rule |
1.0.0
8 years ago