1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-09-02 01:31:57 +02:00

simplify Application creation; update url dispatch guide section

This commit is contained in:
Nikolay Kim
2017-12-11 14:16:29 -08:00
parent caca907c23
commit 0f75d066f2
24 changed files with 512 additions and 207 deletions

View File

@@ -81,7 +81,7 @@ fn main() {
let sys = actix::System::new("example");
HttpServer::new(
Application::new("/")
Application::new()
.resource("/", |r| r.method(Method::GET).f(index)))
.serve::<_, ()>("127.0.0.1:8088").unwrap();
@@ -115,7 +115,7 @@ fn index(req: HttpRequest) -> FutureResult<HttpResponse, Error> {
}
fn main() {
Application::new("/")
Application::new()
.resource("/async", |r| r.route().a(index))
.finish();
}
@@ -140,7 +140,7 @@ fn index(req: HttpRequest) -> HttpResponse {
}
fn main() {
Application::new("/")
Application::new()
.resource("/async", |r| r.f(index))
.finish();
}