PostProcessHandler
A post process handler will be called after an endpoint is finished processing for every endpoint in an endpoint group. For example, if you had an endpoint group called userSecurityEndpointGroup
that handled processing security changes on an account in your API, you could define a post process handler that would log the request information.
If you throw an error in a post process handler it will be logged but it will not be sent to the client. Remember, a post process handler has not even started to process until after the response is sent to the client.
endpointGroup.setPostProcessHandler(async(req: HRequest, res: HResponse) => {
});
Created by Elijah Cobb provided under the MIT license.
- Home
- Examples
- Creating an Endpoint
- Requests
- Responses
- Files
- Enforcing Types
- Endpoint Groups
- Creating a Server
- Using
HObject
- Error Handling
- Dynamic Endpoints
- Post Process Handler
Element is a group of developer tools I have built in TypeScript. Check them out at: element-ts.com.
Author: Elijah Cobb
NPM: @element-ts/hydrogen
Issue Reporting: Github Issues