Expose custom API via Engage port
You can add custom APIs via Engage proxy.
To expose custom API via Engage port:
- Navigate to ae.properties.
- Provide value for CUSTOM_API_ENDPOINT. This value will be used as a part of based URI.
- Provide value for CUSTOM_API_PORT. Provide value, URI: Port number, in case of multiple projects coma separated list can be provided.
- if authentication is successful, the request is sent to the mentioned port number and USER ID Will be passed in http header.
- if authentication fails, the proxy resends the error request to localhost only.
- Sample Configuration: 1
CUSTOM_API_ENDPOINT=customapi
CUSTOM_API_PORT=project1:3000
- All the API requests going to http://ae-server:8443/customapi/project1/ (any URI) must be routed to http://localhost:3000/ (URI from org request) without /customapi/project1.
- Sample Configuration: 2
CUSTOM_API_ENDPOINT=customapi
CUSTOM_API_PORT=project1:3000,project2:3001
- All the API requests going to http://ae-server:8443/customapi/project1/ (URI) must be routed to http://localhost:3000/ (URI) without /customapi/project1.
- Additionally, all the API requests going to http://ae-server:8443/customapi/project2/ (URI) must be routed to http://localhost:3001/ (URI) without /customapi/project2.
- APIs can be configured without authentication using CUSTOM_API_ENDPOINT_NOAUTH and CUSTOM_API_PORT_NOAUTH variables.
- Ensure to use unique port numbers to avoid any issues.
URI will be formed. For example: http(s)://{ae-server}:{pe-port}/{CUSTOM_API_ENDPOINT}/{}/.CUSTOM_API_ENDPOINT=customapi
CUSTOM_API_PORT=CUSTOM_API_ENDPOINT_NOAUTH=customapi_noauth