Expose custom API via Engage port

You can add custom APIs via Engage proxy.

 

To expose custom API via Engage port:

 

  1. Navigate to ae.properties.
  2. Provide value for CUSTOM_API_ENDPOINT. This value will be used as a part of based URI.
  3. Provide value for CUSTOM_API_PORT. Provide value, URI: Port number, in case of multiple projects coma separated list can be provided.
    1. if authentication is successful, the request is sent to the mentioned port number and USER ID Will be passed in http header.
    2. if authentication fails, the proxy resends the error request to localhost only.
  4. Sample Configuration: 1

    CUSTOM_API_ENDPOINT=customapi

    CUSTOM_API_PORT=project1:3000

    1. 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.
  5. Sample Configuration: 2

    CUSTOM_API_ENDPOINT=customapi

    CUSTOM_API_PORT=project1:3000,project2:3001

    1. All the API requests going to http://ae-server:8443/customapi/project1/ (URI) must  be routed to http://localhost:3000/ (URI)  without /customapi/project1.
    2. 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.
  6. APIs can be configured without authentication using CUSTOM_API_ENDPOINT_NOAUTH and CUSTOM_API_PORT_NOAUTH variables.
  7. 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