mirror of https://github.com/rwf2/Rocket.git
Updated README with more thorough example.
This commit is contained in:
parent
852120e23a
commit
782536e43f
|
@ -11,9 +11,9 @@ does, the following will be the canonical "Hello, world!" example:
|
||||||
extern crate rocket;
|
extern crate rocket;
|
||||||
use rocket::Rocket;
|
use rocket::Rocket;
|
||||||
|
|
||||||
#[route(GET, path = "/hello")]
|
#[route(GET, path = "/hello/<name>")]
|
||||||
fn hello() -> &'static str {
|
fn hello(name: &'static str) -> String {
|
||||||
"Hello, world!"
|
format!("Hello, {}!", name)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -37,6 +37,9 @@ cargo build
|
||||||
cargo run
|
cargo run
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Then visit `localhost:8000/hello/{some_name}`, replacing `{some_name}` with some
|
||||||
|
name.
|
||||||
|
|
||||||
### OS X
|
### OS X
|
||||||
|
|
||||||
Apple has stopped shipping `openssl` with OS X.11. As such, if your build fails
|
Apple has stopped shipping `openssl` with OS X.11. As such, if your build fails
|
||||||
|
|
Loading…
Reference in New Issue