fej/src/hello/mod.rs

17 lines
330 B
Rust

#[cfg(test)] mod tests;
#[get("/world")]
pub fn world() -> &'static str {
"Hello, world!"
}
#[get("/<name>")]
pub fn hello(name: String) -> String {
format!("Hello, {}", name)
}
#[get("/world?<name>&<age>")]
pub fn name_age(name: String, age: u16) -> String {
format!("Hello, {} who is {} years old!", name, age)
}