Skip to content

Instantly share code, notes, and snippets.

@sean3z
Created April 13, 2017 19:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sean3z/e4f77ebe4df8d119c9aaeb237c01d5af to your computer and use it in GitHub Desktop.
Save sean3z/e4f77ebe4df8d119c9aaeb237c01d5af to your computer and use it in GitHub Desktop.
Example Rocket route
#[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