Skip to content

xp-fly/egg-route-decorator

Repository files navigation

egg-route-decorator

NPM version build status Test coverage David deps Known Vulnerabilities npm download

Install

$ npm i egg-route-decorator --save

Usage & Configuration

  • Enable plugin in config/plugin.js
exports.routeDecorator = {
  enable: true,
  package: 'egg-route-decorator',
};
  • Edit your own configurations in conif/config.{env}.js
exports.routeDecorator = {
};

Example

HttpController

@HttpController(path?: string) 用于装饰控制器,表示当前路由控制器的公共前缀

Get

@Get(path?: string) 装饰get请求

Post

@Post(path?: string) 装饰post请求

Put

@Put(path?: string) 装饰put请求

Delete

@Delete(path: string) 装饰Delete请求

参数校验

Full Example

Questions & Suggestions

Please open an issue here.

License

MIT

About

egg的ts装饰器路由

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published