Skip to content

Instantly share code, notes, and snippets.

@sean3z
Last active March 18, 2018 15:37
Show Gist options
  • Save sean3z/12f1299143c5b63b7d30c3425d44518e to your computer and use it in GitHub Desktop.
Save sean3z/12f1299143c5b63b7d30c3425d44518e to your computer and use it in GitHub Desktop.
Rocket Getting Started snippet
#![feature(plugin)]
#![plugin(rocket_codegen)]
extern crate rocket;
#[get("/<name>/<age>")]
fn hello(name: String, age: u8) -> String {
format!("Hello, {} year old named {}!", age, name)
}
fn main() {
rocket::ignite()
.mount("/hello", routes![hello])
.launch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment