Using the configuration file.

Set authentication endpoint in configuration file

To enhance security and flexibility, you can directly set the notification endpoints in the configuration.json-file.

Example configuration for notification endpoints:

"event_callbacks": [
  {
    "type": "onRelease",
    "url": "https://my-url.com/tmining",
    "secret": "wbLF2qz8bbsWY6"
  }
]

You can configure multiple callbacks by listing them in an array, allowing you to set different endpoints for different types of notifications.


Set API Network Settings in configuration file.

The configuration.json file also contains network settings:

  • On line 2, you can enable or disable SSL by setting the protocol to either https (for SSL) or http (without SSL):

    "protocol": "https",
  • If SSL is enabled, specify the certificates to use:

    "httpServer": {
      "port": 4431,
      "ssl": {
        "serverCert": "certificates/server-cert.pem",
        "serverKey": "certificates/server-key.pem"
      }
    }
  • On line 32, you can update the port number used for incoming requests:

    "httpServer": {
      "port": 5000
    }

Set logging parameters in configuration file.

You can fine-tune logging by modifying the log4js section in the configuration.json-file. The most important setting is the level parameter:

Default logging, level setting - debug

"level": "debug"

Increased logging, level setting - trace

"level": "trace"

Configure log, file settings.

EXAMPLE for compressing the logs automatically and using rotating logfiles with a limited size:

"file": {
"type": "dateFile",
"filename": "api.log",
"numBackups": "7",
"compress": true,
"layout": {
"type": "pattern",
"pattern": “%[%d %p [%f{2}:%l]%] %m%n"
}
}

Above configuration retains 7 compresse log backups.

Last updated