Skip to content

Instantly share code, notes, and snippets.

@trimoq
Created October 21, 2019 08:55
Show Gist options
  • Save trimoq/b44e14ff5e5fc4c4ce89f493dbe2fa96 to your computer and use it in GitHub Desktop.
Save trimoq/b44e14ff5e5fc4c4ce89f493dbe2fa96 to your computer and use it in GitHub Desktop.
Tiny hello world code
#[macro_use]
extern crate rocket;
#[get("/hello/<name>")]
fn hello(name: String) -> String {
format!("hello {}", name)
}
fn main() {
rocket::ignite()
.mount("/", routes![hello])
.launch();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment