Skip to content

Commit

Permalink
Add log
Browse files Browse the repository at this point in the history
  • Loading branch information
bennekrouf committed Feb 7, 2024
1 parent d34aa8a commit 567b118
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/utils/yml_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,11 @@ pub fn load_config<T>(config_path: &str) -> T
where T: DeserializeOwned,
{
let app_env = env::var("APP_ENV").unwrap_or_else(|_| "local".to_string());
println!("APP_ENV: {}", app_env);

let config_path = format!("{}.{}.yml", config_path, app_env);
println!("Looking for config file at: {}", config_path);

let config_str = std::fs::read_to_string(&config_path)
.expect("Failed to read config file");
serde_yaml::from_str(&config_str).expect("Failed to parse config file")
Expand Down

0 comments on commit 567b118

Please sign in to comment.