【文件属性】:
文件名称:koa-smart:基于Koajs2的框架,带有Decorator,Params Checker和模块基础(cors,bodyparser,compress,I18n等),可让您轻松开发智能api
文件大小:174KB
文件格式:ZIP
更新时间:2024-06-17 06:21:51
boilerplate framework router parameters decorators
KoaSmart是基于Koajs2一个框架,它可以让你开发RESTful API中有:类,装饰,PARAMS检查
一个基于的框架,带有装饰器,参数检查器和模块基础( , , , 等),可让您轻松开发智能api
export default class RouteUsers extends Route {
// get route: http://localhost:3000/users/get/:id
@ Route . Get ( {
path : 'get/:id'
} )
async get ( ctx ) {
const user = await this . models . users . findById ( ctx . params . id ) ;
this . assert ( user