use stratify::config::Builder;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let store = Builder::default()
.json("examples/config/base.json", 100) .yaml("examples/config/production.yaml", 50) .toml("examples/config/app.toml", 10) .build()
.await?;
println!(
"winner: database.host = {:?}",
store.get_str("database.host")
);
assert_eq!(
store.get_str("database.host").as_deref(),
Some("db.toml.internal")
);
println!(
"app.workers survives from the base file: {:?}",
store.get_str("app.workers")
);
Ok(())
}