#![allow(deprecated)]
use config::{ Config, Environment, File};
use std::env;
pub fn get_config() -> Config {
let run_mode = env::var("RUN_MODE").unwrap_or_else(|_| "development".into());
let env_settings = Environment::new();
let s = Config::builder()
.add_source(File::with_name("config/config.json"))
.add_source(File::with_name(&format!("config/config-{}", run_mode)).required(false))
.add_source(env_settings.prefix("app").separator("_"))
.build()
.unwrap();
s
}