1.0.2 • Published 6 years ago

egg-pcyang-auto-router v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
6 years ago

#使用

  • 1、控制器中
import R from 'egg-pcyang-auto-router';
@R.prefix("/app/home", ['page','add','info','update','delete','list']) //默认的几个方法可以写在这
export default class HomeController extends Controller {
  //全路径,方法可以是get,post,put,delete,options,patch,all
  @R.get("/app/home/index") 
  public async index() {
    const { ctx } = this;
    ctx.body = await ctx.service.test.sayHi('egg');
  }
}
  • 2、router.js
import R from 'egg-pcyang-auto-router';
export default (app: Application) => {
  R.init(app) //注册路由
  //其他自定义路由
  ...
};
1.1.7

6 years ago

1.1.6

6 years ago

1.1.5

6 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago