From 782536e43f72f416ec1d353b328c41d8d6ee59fa Mon Sep 17 00:00:00 2001 From: Sergio Benitez Date: Thu, 17 Mar 2016 19:56:23 -0700 Subject: [PATCH] Updated README with more thorough example. --- README.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d0f9df12..bfcfbe09 100644 --- a/README.md +++ b/README.md @@ -11,9 +11,9 @@ does, the following will be the canonical "Hello, world!" example: extern crate rocket; use rocket::Rocket; -#[route(GET, path = "/hello")] -fn hello() -> &'static str { - "Hello, world!" +#[route(GET, path = "/hello/")] +fn hello(name: &'static str) -> String { + format!("Hello, {}!", name) } fn main() { @@ -37,6 +37,9 @@ cargo build cargo run ``` +Then visit `localhost:8000/hello/{some_name}`, replacing `{some_name}` with some +name. + ### OS X Apple has stopped shipping `openssl` with OS X.11. As such, if your build fails