Skip to content

einsqing/koa-http-router

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

koa自动加载路由 不区分http请求方法

Installation

$ npm install koa-resource-router

Use with koa

var app = require('koa')();
var koaResourceRouter = require('koa-resource-router');
app.use(koaResourceRouter(app, {
    root: './app/controller',
    suffix: '.js',
    action: 'index'
}));

exports.index = function*(ctx, next){
	console.log(ctx);
	console.log(ctx.query);
	console.log(ctx.params);
}

作者官网: http://www.wemallshop.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published