This directory contains all server code for the Strimzi UI - ie code which is responsible for the serving of and back channel logic to support the client code. A summary of contents can be found below:
api- module which proxies backend requests to the configured strimzi-admin serverclient- handlers for returning built client code to a user's web browser.config- module which serves UI configuration to the client.core- the core express server logic. This document also covers how the core module interacts with the other modules.log- module that handles client logging events.mockapi- handlers for emulating a real instance ofStrimzi-adminin dev and test scenarios. Also allows the configuration of the server to be changed to enable test scenarios.test- common test code and helpers for the UI server.logging.ts- logging handling module. Uses the logging configuration from the server's configuration to create thepinoandpino-httploggers, and extends the Logger object with entry and exit tracing methods.main.ts- the build entry point for the production UI server. It bootstraps the server, and owns the creation and management of a nodehttp/httpsserver (and binding express to it).serverConfig.ts- configuration handling module. If anconfigPathenvar is provided, the file specified is used for the server's configuration, else,server.config.jsonin the current working directory will be used. If neither exist, a default config defined in this module will be used.types.ts- custom types and interfaces used in the server code base.tsconfig.json- Typescript config for this codebase.jest.config.js- Jest config for this codebase.
As described in the configuration approach, the UI server's configuration is provided via a file, which is then watched at runtime for modification. This configuration file is expected to be called server.config.json (available in the same directory as the node executable is run from), but this can be configured at runtime via environment variable configPath, dictating a different path and file name. The file must be either valid JSON or JS. The server also hosts configuration for discovery by the client via the config module. The configuration options for the server provided in the previously mentioned configuration file are as follows:
