pub struct AppConfig {
pub name: String,
pub version: String,
pub debug: bool,
pub root_path: String,
pub root_path_in_servers: bool,
pub trailing_slash_mode: TrailingSlashMode,
pub debug_config: DebugConfig,
pub max_body_size: usize,
pub request_timeout_ms: u64,
}Expand description
Application configuration.
Fields§
§name: StringApplication name (used in logging and OpenAPI).
version: StringApplication version.
debug: boolEnable debug mode.
root_path: StringRoot path for proxied deployments (FastAPI’s root_path).
When set, URL generation and redirects should be prefixed with this path.
root_path_in_servers: boolWhether to include the root_path in OpenAPI servers entries.
trailing_slash_mode: TrailingSlashModeTrailing slash normalization mode for routing.
debug_config: DebugConfigDebug surface configuration (e.g. debug endpoints / debug auth).
max_body_size: usizeMaximum request body size in bytes.
request_timeout_ms: u64Default request timeout in milliseconds.
Implementations§
Source§impl AppConfig
impl AppConfig
Sourcepub fn root_path(self, root_path: impl Into<String>) -> Self
pub fn root_path(self, root_path: impl Into<String>) -> Self
Set the root path for proxied deployments.
The value is normalized: trailing slashes are stripped, and the value
must start with / (or be empty). This prevents misconfigured
root paths from producing broken redirects or URL generation.
Sourcepub fn root_path_in_servers(self, enabled: bool) -> Self
pub fn root_path_in_servers(self, enabled: bool) -> Self
Control whether root_path is included in OpenAPI servers.
Sourcepub fn trailing_slash_mode(self, mode: TrailingSlashMode) -> Self
pub fn trailing_slash_mode(self, mode: TrailingSlashMode) -> Self
Configure trailing slash normalization for routing.
Sourcepub fn debug_config(self, config: DebugConfig) -> Self
pub fn debug_config(self, config: DebugConfig) -> Self
Configure debug behavior.
Sourcepub fn max_body_size(self, size: usize) -> Self
pub fn max_body_size(self, size: usize) -> Self
Sets the maximum request body size.
Sourcepub fn request_timeout_ms(self, timeout: u64) -> Self
pub fn request_timeout_ms(self, timeout: u64) -> Self
Sets the default request timeout in milliseconds.