Add Endpoint Route
Create an endpoint with a custom handler
Description
Add an endpoint on a specific Route for a given Method.
The Handler will receive the request and build the response, here are some examples:
- Use the Gateway SQL bricks to query a database
- Use HTTP bricks to call a REST API
- Build a full custom logic inside a coded brick
Inputs
- Control Flow (Control Flow)
- Route (String): The route identifies the endpoint. This is NOT the route used with the requests from Web Apps (Mule in the middle)... This is what you put in the headers 'resource' parameter.
- Method (Endpoint Method): The method to access the endpoint. This is NOT the method used to request from the Web Apps (Mule between the gateway and web app)... This is what you put in the 'method' header.
- Handler (Endpoint Handler Signature): Define what the handler of this endpoint does. Any pre-/post- processing is done in there as well.
- Body Schema (Type): JSON string for the body schema. See https://www.fastify.io/docs/latest/Reference/Validation-and-Serialization/#validation for the
bodyJsonSchema
JSON.
Outputs
- Control Flow (Control Flow)
- Error (Error Flow)