Created
April 13, 2017 19:04
-
-
Save sean3z/e4f77ebe4df8d119c9aaeb237c01d5af to your computer and use it in GitHub Desktop.
Example Rocket route
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[get("/hello/<name>/<age>/<cool>")] | |
fn hello(name: &str, age: u8, cool: bool) -> String { | |
if cool { | |
format!("You're a cool {} year old, {}!", age, name) | |
} else { | |
format!("{}, we need to talk about your coolness.", name) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment