From 5e6a0aa3dfda610eb3e6aef647f3aa9a9ae59649 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 10 Apr 2018 10:39:16 -0700 Subject: [PATCH] simplier example in readme --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e8f93a92b..450240ca5 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ Actix web is a simple, pragmatic and extremely fast web framework for Rust. ```rust extern crate actix_web; -use actix_web::{server, App, Path}; +use actix_web::{http, server, App, Path}; fn index(info: Path<(u32, String)>) -> String { format!("Hello {}! id:{}", info.0, info.1) @@ -42,7 +42,7 @@ fn index(info: Path<(u32, String)>) -> String { fn main() { server::new( || App::new() - .resource("/{id}/{name}/index.html", |r| r.with(index))) + .route("/{id}/{name}/index.html", http::Method::GET, index)) .bind("127.0.0.1:8080").unwrap() .run(); }