Skip to main content

Module config

Module config 

Source
Expand description

Built-in configuration support: appsettings.json + AppOptions pattern.

The framework automatically loads appsettings.json (merged with appsettings.Development.json in dev mode) and binds it to the built-in AppOptions struct. Users customize options via HostBuilder::configure(|app| app.useOptions(|o| { ... })).

Structs§

AppOptions
Standard application options loaded from appsettings.json.
AppSection
Top-level application section.
CorsSection
CORS (Cross-Origin Resource Sharing) section.
JwtSection
JWT authentication section.
MetricsSection
HTTP request metrics (GET /metrics Prometheus text when enabled).
RateLimitSection
Per-IP rate limiting (token bucket).
TlsSection
TLS (Transport Layer Security) section.

Traits§

IAppOptions
Application options — binds to a section of appsettings.json.

Functions§

bind_config
Bind a section of the config JSON to a deserializable type.
bind_root
Bind the entire config JSON to a type (for root-level deserialization).
load_appsettings
Load the merged appsettings JSON (base + environment overlay + env overrides).