在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:t2ee/vader开源软件地址:https://github.com/t2ee/vader开源编程语言:TypeScript 97.6%开源软件介绍:IMPORTANT !!
Introducation@t2ee/vader is a routing component (with JAX-RS like grammars). It is to be used with koa@2. For detailed introduction and examples, please visit vader.t2ee.org Installation
Exampleimport 'reflect-metadata';
import * as Koa from 'koa';
import {
Path,
Router,
QueryParam,
Response,
GET,
} from '@t2ee/vader';
const router = Router.newInstance();
@Path('')
class Controller {
@GET
@Path('/say')
say(@QueryParam('message') message: string) {
const response = new Response();
response.body = message;
return response;
}
}
router.use(Controller);
const app = new Koa();
app.use(router.routes());
app.listen(8080); |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论