Skip to main content

Configuring the API Gateway

All configuration for the API gateway is in the file /ApiGateway/config.json.

Keycloak

To configure the Keycloak server used for authentication, please update the auth-server-url property:

"auth-server-url": "http://localhost:8080/"

API Services

API services that are handled by the API gateway must have a config entry in the services property like the following:

{
"serviceName": "example",
"incomingRoute": "/example/*",
"baseUrl": "http://localhost:8080",
"getHandler": "genericGet",
"postHandler": "genericPost",
"putHandler": "genericPut",
"forwardHeaders": ["*"],
"headers": {},
"queryStrings": {}
}

Where the config entry has the following properties:

PropertyDescription
serviceNameThe name of the API service.
commentThe description of the API service (optional).
incomingRouteThe incoming request path (to the API gateway). The wildcard character * can be used.
baseUrlThe API domain name and port to which the request should be forwarded.
getHandlerThe method to handle GET requests to the API. Use genericGet by default.
postHandlerThe method to handle POST requests to the API. Use genericPost by default.
putHandlerThe method to handle PUT requests to the API. Use genericPut by default.
forwardHeadersList of header keys to be forwarded. The wildcard character * can be used to forward all headers.
headersAdditional key/value pairs for headers to be added to the request.
queryStringsAdditional key/value pairs for request paramaters to be added to the request URL.

Port Number

By default the API gateway uses port 8085. If you need to change this for some reason, please update the port number in the following locations:

  • port property in /ApiGateway/config.json
  • TESERVER property in /TemenosExplorer/public/TA_config.js (i)
  • LOGURL property in /TemenosExplorer/public/TA_config.js (i)
  • Any plugin specific properties/URLs which reference the API gateway

(i) See/consider ConfigServlet if Temenos Exporer is going to be deployed as a WAR

Building the API Gateway

After cloning the repository to your local machine you will need to build the API gateway before you can use it. To build the API gateway follow these steps:

  1. Go to the terminal (select "Terminal -> New Terminal" from the file menu if no terminal is open)
  2. Navigate to the ApiGateway folder
  3. Run the command npm install

Running the API Gateway

To use the API gateway you need to follow these steps:

  1. Go to the terminal (select "Terminal -> New Terminal" from the file menu if no terminal is open)
  2. Navigate to the ApiGateway folder
  3. Run the command npm run start

It is recommended to run the API gateway in a separate terminal as you will likely need this to be running in the background while you do your work in another terminal.

Server-Side Logging

The API gateway tool logs all output to the following file:

/ApiGateway/logs/app.log

This file must be excluded from commits which will be merged with the development branch.