-
Notifications
You must be signed in to change notification settings - Fork 107
@PostProcessor Decorator
Thiago Bustamante edited this page Feb 19, 2019
·
1 revision
It is possible to add a function to run after the handler on an endpoint. It is similar to PreProcessor, but executed after the endpoint service.
function logProcessor(req: express.Request): express.Request {
console.log('Endpoint executed');
}
@Path('myservice')
export class MyService {
@Path('test')
@POST
@PostProcessor(logProcessor)
test(body: any) {
}
}
PostProcessors can also be added to a class, applying it to all endpoints on the class
@Path('myservice')
@PostProcessor(logProcessor)
export class MyService {
@Path('test')
@POST
test(body: any) {
}
}
- Server
- @Path Decorator
- Http Methods
- Request Parameters
- Types and languages
- @BodyOptions Decorator
- Service Context
- Service Return
- @Security Decorator
- Express Middlewares
- @PreProcessor Decorator
- @PostProcessor Decorator
- Server Errors
- Service Factory and IoC
- Inheritance and Abstract Services
- Swagger Documentation