【文件属性】:
文件名称:koa-router-decorator:用于koa-router的@route装饰器
文件大小:4KB
文件格式:ZIP
更新时间:2021-02-03 17:34:50
koa router KoaTypeScript
Koa装饰器
用于koa-router的@route装饰器
利用
安装方式:
npm i koa-decorator
然后在代码中使用:
import { HttpMethod , route } from 'koa-decorator' ;
@ route ( '/monitor' )
export default class MonitorCtrl {
@ route ( '/alive' , HttpMethod . GET )
async alive ( ctx ) {
ctx . body = {
data : true ,
} ;
}
【文件预览】:
koa-router-decorator-master
----index.ts(4KB)
----.npmignore(59B)
----tsconfig.json(409B)
----README.md(1KB)
----.editorconfig(134B)
----.gitignore(98B)
----package.json(386B)