init
Some checks failed
CI / ci (push) Failing after 1m48s

This commit is contained in:
2026-08-25 23:24:36 +02:00
commit 95739892de
466 changed files with 33918 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
use config::AppConfig;
const CONFIG_FILE: &str = "config.toml";
pub fn load() -> Result<AppConfig, Box<dyn std::error::Error>> {
let path = std::path::Path::new(CONFIG_FILE);
if path.exists() {
let content = std::fs::read_to_string(path)?;
let config: AppConfig = toml::from_str(&content)?;
tracing::info!(path = CONFIG_FILE, "loaded config from file");
Ok(config)
} else {
tracing::info!("no config file found, using defaults");
Ok(AppConfig::default())
}
}