egg-route-decorators
v0.0.5
Published
```javascript import { Prefix, RequestMethods, Path } from 'egg-route-decorators';
Downloads
1
Readme
Usage
controller
import { Prefix, RequestMethods, Path } from 'egg-route-decorators';
@Prefix('/user')
export default class UserController extends Controller {
@RequestMethods(['GET', 'POST'])
@Path('/example')
public index() {
const { ctx } = this;
ctx.body = { msg: 'success' };
}
}
router
import { RouteLoader } from 'egg-route-decorators';
export default ()=>{
RouteLoader(app, '/api/v1');
}