Skip to content

auto register router from floder/controller/method

Notifications You must be signed in to change notification settings

orchie/koa-autoregroute

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

koa自动加载路由

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'
}));

改进

  1. 可以指定非自动路由目录
  2. 自动定位控制器内方法

About

auto register router from floder/controller/method

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published