claudia-api-builder-typescript
v1.1.1
Published
Typescript support for claudia-api-builder library
Downloads
3
Readme
claudia-api-builder-typescript
Simple example
import { BaseApi, Controller, Middlewares, Get } from 'claudia-api-builder-typescript';
@Controller('/users')
class UsersController {
@Get()
@Middlewares([req => console.log(req.body), req => console.log(req.pathParams)])
getAllUsers() {
return { message: 'All users!' };
}
}
class Api extends BaseApi {
getControllers() {
return [new UsersController()];
}
}
export = new Api().apiBuilder;