Skip to main content

ConfigService Deep Dive

The central authority for application settings, providing type-safe access to the merged configuration across the server environment.

Key Functionalities

get(path?)

Retrieves values using dot-notation (e.g., config.get('server.api.host')). It automatically selects the correct value based on whether a request-specific override is present in the current ServerContext.

Multi-tenant / Multi-country Logic

The ConfigService is aware of the multiCountry flag. It can automatically switch the active configuration based on request headers or hostnames, allowing the same server instance to serve multiple tenants or regions with distinct settings.

replace(config)

Allows for a complete hot-swap of the underlying configuration object, which is primarily used during testing or specialized bootstrap sequences.