decorator-egg
使用装饰器给 egg 注册路由
Usage
For Install
npm install --save decorator-egg
Setup
In router.ts
or route.js
// router.ts or route.js;;
Prefix Url Globally
// router.ts or `router.js` // controller.ts or `controller.js` @ //===>>/api/user async { thisctxbody = 'hello, decorator-egg.' }
Prefix Url For Controller
// controller.ts or `controller.js` @ @ //===>>/home/test async { thisctxbody = 'hello, decorator-egg.' }
Router Middleware
Router middleware will run before the target function.
Example
;; // @routerDecorator.prefix('/example') // isLogin middleware // hasDelAuth middleware
The MIT License (MIT)