#[macro_use] extern crate rocket; use dotenv::dotenv; mod weather; #[get("/weather/")] async fn get_weather(loc: String) -> Result { let sum = weather::get_summary(&loc).await?; Ok(format!("The weather in {} is: {:?}", loc, sum)) } #[rocket::launch] fn rocket() -> rocket::Rocket { dotenv().ok(); rocket::ignite().mount("/", routes![get_weather]) }