1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-28 01:32:57 +01:00

update readme example

This commit is contained in:
Nikolay Kim 2018-01-02 19:57:25 -08:00
parent 7af3b3f956
commit 9e6d090fd0

View File

@ -3,6 +3,8 @@
Actix web is a small, fast, down-to-earth, open source rust web framework. Actix web is a small, fast, down-to-earth, open source rust web framework.
```rust,ignore ```rust,ignore
extern crate actix;
extern crate actix_web;
use actix_web::*; use actix_web::*;
fn index(req: HttpRequest) -> String { fn index(req: HttpRequest) -> String {
@ -10,11 +12,14 @@ fn index(req: HttpRequest) -> String {
} }
fn main() { fn main() {
let sys = actix::System::new("readme");
HttpServer::new( HttpServer::new(
|| Application::new() || Application::new()
.resource("/{name}", |r| r.f(index))) .resource("/{name}", |r| r.f(index)))
.bind("127.0.0.1:8080")? .bind("127.0.0.1:8080").unwrap()
.start(); .start();
sys.run();
} }
``` ```