koa-autoregroute
v1.0.1
Published
auto register router from floder/controller/method
Downloads
3
Readme
koa自动加载路由
基于koa-autoload-router
Installation
$ npm install koa-autoregroute
Use with koa
var app = require('koa')();
var autoRegRoute = require('koa-autoregroute');
app.use(autoRegRoute(app, {
root: './app/controller',
suffix: '.js',
prefix: '/v1'
}));
改进
- 可以指定非自动路由目录
- 自动定位控制器内方法