pub fn load_config(file_path: &str) -> Result<Config, Box<dyn Error>>
Expand description

Loads the application configuration from a YAML file.

Arguments

  • file_path - Path to the YAML configuration file.

Returns

This function returns Config on success or an error if the file cannot be read or the contents cannot be parsed into a Config.

Examples

use chat_flame_backend::config::load_config;
let config = load_config("path/to/config.yml").unwrap_or_default();
println!("Server will run on port: {}", config.port);