Routes that read like code
A controller prefix and an HTTP decorator become a real Koa route. Bootstrap mounts it and returns the app.
@Controller('/users')
class UserController {
@Get('/:id')
getOne(@Params('id') id: string) {
return {id};
}
}
async function main() {
const {app} = await bootstrapControllers({
controllers: [UserController],
});
app.listen(3000);
}
void main();