#![feature(proc_macro_hygiene, async_await)] #[macro_use] extern crate rocket; #[cfg(test)] mod tests; use rocket::response::content; #[get("/hello//")] fn hello(name: String, age: i8) -> String { format!("Hello, {} year old named {}!", age, name) } #[catch(404)] fn not_found(req: &rocket::Request<'_>) -> content::Html { content::Html(format!("

Sorry, but '{}' is not a valid path!

Try visiting /hello/<name>/<age> instead.

", req.uri())) } fn main() { let e = rocket::ignite() // .mount("/", routes![hello, hello]) // uncoment this to get an error .mount("/", routes![hello]) .register(catchers![not_found]) .launch(); println!("Whoops! Rocket didn't launch!"); println!("This went wrong: {}", e); }