Koa wrapper using decorators
npm install lagiacrus
hello.controller.ts
@Controller({
path: '/hello'
})
export class HelloController {
@Get('/')
displayWorld(): string {
return 'world';
}
}
main.ts
async function main(): Promise<http.Server> {
const server = new Server();
server.mount(HelloController);
return await server.start(3000);
}
main().then(() => console.log('Listening...')).catch(console.error);