diff --git a/examples/config/src/main.rs b/examples/config/src/main.rs index f10e5d67..4e9ff20d 100644 --- a/examples/config/src/main.rs +++ b/examples/config/src/main.rs @@ -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) + })) +}