Micro Gateway environment variables

Use environment variables to customize the Micro Gateway configuration.

Micro Gateway environment variables

Important: IBM® API Connect Micro Gateway is deprecated in IBM API Connect Version 5.0.8 in favor of DataPower® Gateway. From 1 April 2020, Micro Gateway, and associated toolkit CLI commands, will no longer be supported. Existing users can migrate their API definitions to IBM DataPower Gateways. For information on supported API policies, see Built-in policies.
Environment variables can be used to customize the Micro Gateway configuration and behavior. Environment variables might apply to only the developer toolkit environment, to the on-premises environment, or to both environments.
Table 1. Micro Gateway environment variables
Name Description developer toolkit On-premises
APIC_CONFIG_PATH Specifies the directory path containing the system logging configuration file, logger-config.json. Applicable Not applicable
APIC_LOG_CONFIG_FILE Specifies the path of the user-level logging configuration. Applicable Not applicable
APIC_LOG_CONSOLE_LEVEL Specifies the lowest level of messages logged to the console stream.
Use the following valid values:
  • fatal
  • error
  • warn
  • info
  • debug
  • trace
The default value is warn.
Applicable Not applicable
APIC_LOG_FILE_LEVEL Specifies the lowest level of messages logged to the apic.log log file.
Use the following valid values:
  • fatal
  • error
  • warn
  • info
  • debug
  • trace
The default value is info.
Applicable Not applicable
APIMANAGER Specifies the host of the API Connect management server to connect to. Not applicable Applicable
APIMANAGER_CATALOG Specifies the Catalog that the Micro Gateway is responsible for servicing. Not applicable Applicable
APIMANAGER_PORT Specifies the port to connect to the API Connect management server on. Not applicable Applicable
APIMANAGER_REFRESH_INTERVAL Specifies, in milliseconds, the interval to wait before fetching updated artifacts from the API Connect management server.

The default value is 15 minutes.

Not applicable Applicable
CATALOG_HOST Specifies the IP address and port of the gateway in <IPAddress>:port format. The value is used in OpenAPI (Swagger 2.0) in the $(catalog.host) variable for use by the explorer to locate the gateway.

The default value is localhost:gatewayport.

Applicable Not applicable
CONFIG_DIR Specifies the directory of OpenAPI (Swagger 2.0) to load. Not applicable. Applicable.

This value is used for the initial load. For subsequent loads, on-premises loads into ./config.

DATASTORE_PORT Specifies the port that the data store listens on for requests. By default, the data store binds to port 0, causing an ephemeral port listen. If set before startup, the data store listens on that port. Applicable Applicable
LAPTOP_RATELIMIT Specifies the rate limit per hour to apply for all requests. This environment variable must be set before starting the Micro Gateway. The default value is 100.
For example, the following command sets the rate limit to 1000 requests per hour:
export LAPTOP_RATELIMIT=1000/hour
Applicable Not applicable
PORT Specifies the port that the Micro Gateway listens on for incoming traffic. Specify a value in the range of 1024 - 64000. The default values are 80 for HTTP and 443 for HTTPS stand alone when started with Node.js.
Note: To listen on ports less than 1024 (including the default ports), the gateway needs to be started by the root user. There is potential risk to run an application as the root user, therefore, it is advised to specify a value greater than 1024.
Applicable Applicable
TLS_SERVER_CONFIG Contains the path name, possibly relative, to a JSON file that contains the TLS configuration for the Micro Gateway to expect HTTPS communication.

The Micro Gateway includes a self-signed cert for development. To use the self-signed certificate, when prompted, update the browser's trusted keystore to include the Micro Gateway self-signed certificate.

The Micro Gateway does not include a trusted CA-signed certificate for production. Instead, use the TLS_SERVER_CONFIG environment variable to specify your own trusted CA-signed certificate for the Micro Gateway.

The JSON file contents should be equivalent to the properties for tls.createServer(options[,secureConnectionListener]) as specified by the Node.js Transport Layer Security documentation.

One exception is that certain properties can specify file names with locations that are relative to the location of the TLS_SERVER_CONFIG file. The following properties can specify relative file names:
  • key
  • cert
  • ca
  • pfx
  • dhparam
  • ticketKeys
For example:
{
  "cert" : "./server-cert.pem",
  "key" : "-----BEGIN RSA PRIVATE KEY-----\nMIICXgIBAAKBgQDT9ONI21tV/pVnHX/... tLgZU4Tw==\n-----END RSA PRIVATE KEY-----"
}
Applicable

When any of the OpenAPI (Swagger 2.0) API definitions include HTTPS within the schemes, the gateway starts listening for HTTPS traffic. If TLS_SERVER_CONFIG is not specified, a default self-signed cert is used.

Applicable
WLPN_APP_ROUTE For API Connect, specifies the organization and environment URL for client requests. Not applicable Applicable