mirror of https://github.com/rwf2/Rocket.git
Print config on attach in config example.
This commit is contained in:
parent
3c25326917
commit
015438a780
|
@ -1,5 +1,15 @@
|
|||
#[cfg(test)] mod tests;
|
||||
|
||||
// This example's illustration is the Rocket.toml file.
|
||||
use rocket::fairing::AdHoc;
|
||||
|
||||
// This example's illustration is the Rocket.toml file. Running this server will
|
||||
// print the config, however.
|
||||
#[rocket::launch]
|
||||
fn rocket() -> rocket::Rocket { rocket::ignite() }
|
||||
fn rocket() -> rocket::Rocket {
|
||||
rocket::ignite()
|
||||
.attach(AdHoc::on_attach("Config Reader", |rocket| async {
|
||||
let value = rocket.figment().find_value("").unwrap();
|
||||
println!("{:#?}", value);
|
||||
Ok(rocket)
|
||||
}))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue