Getting Started

Draft

API Component Configuration

The apis component comes with the installer and is configured by default. If customization is needed, it can be done via the app.config file.

Default Configuration Paths

  • Windows:

    C:/ProgramData/CAST/Imaging/CAST-Imaging-Viewer/setup-config/imagingapis/app.config

  • Linux:

    /opt/cast/installation/imaging-viewer/imaging-apis/config/app.config

Sample Configuration File

Below is a sample app.config file in JSON format:

{
  "PORT": "port",
  "NEO4J_BOLT_ENDPOINT": "neo4jscheme:neo4jboltport",
  "NEO4J_USERNAME": "username",
  "NEO4J_PASSWORD": "password",
  "API_KEY": "",
  "LOG_PATH": "logs path",
  "LOG_LEVEL": "info",
  "TRUSTED_PROXIES": "",
  "ACCESS_CONTROL_ALLOW_ORIGIN": "",
  "ACCESS_CONTROL_ALLOW_METHODS": "",
  "ACCESS_CONTROL_ALLOW_HEADERS": "",
  "EUREKA_HOST": "EUREKA_HOST",
  "EUREKA_PORT": "EUREKA_PORT",
  "SERVICE_HOST": "SERVICE_HOST",
  "SERVICE_NAME": "ImagingAPIs"
}

Authentication

The apis are authenticated using the X-API-KEY. This can be confirgured in the app.config file or can be passed as a HTTP Header X-API-KEY In case X-API-KEY is configured in the app.config and also passed as a HTTP Header the header X-API-KEY takes precedence for authentication.

Usage:

curl -H "X-API-KEY: my-secret-key" http://<domain-url>:8090/imaging/apis/rest/applications

Logger Settings

You can switch between log levels debug and info depending on the level of verbosity you need. ( Default = info)

To set the log level, update the log level in app.config

LOG_LEVEL=info
LOG_LEVEL=debug
  • error: Sets the base level to show only error messages.
  • warning: Includes warning messages in addition to errors.
  • info: Shows informational messages. This is the default and recommended level.
  • debug: Enables verbose output useful for troubleshooting and diagnostics.