Added arguments test
This commit is contained in:
parent
57de7c66b3
commit
e498fb38c8
3 changed files with 15 additions and 1 deletions
|
|
@ -2,3 +2,13 @@
|
|||
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)
|
||||
}
|
||||
|
|
|
|||
Reference in a new issue