Skip to main content

Module config

Module config 

Source
Expand description

Server configuration with startup validation.

Loads configuration from environment variables and validates that all required values are present at startup, not at first use.

§Environment Variables

VariableRequiredDefaultDescription
DATABASE_URLprod-PostgreSQL connection string
JWT_SECRETproddev defaultJWT signing secret
WORKER_TOKENproddev defaultWorker-to-API auth token
PORTno3000HTTP listen port
ALLOWED_ORIGINSnosame-originComma-separated CORS origins
DASHBOARD_DIRnoembeddedFilesystem path to dashboard assets
WEBHOOK_URLno-Outbound webhook URL for notifications
IRONFLOW_ENVnodevelopmentproduction or development

§Examples

use ironflow_api::config::ServerConfig;

let config = ServerConfig::from_env()?;
println!("Listening on port {}", config.port);

Structs§

ConfigError
Configuration validation error.
ServerConfig
Server configuration loaded from environment variables.