Last active
March 18, 2018 15:37
-
-
Save sean3z/12f1299143c5b63b7d30c3425d44518e to your computer and use it in GitHub Desktop.
Rocket Getting Started snippet
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
#![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