1
0
mirror of https://github.com/actix/actix-extras.git synced 2025-06-25 01:51:23 +02:00

use Route for Applicaiton handlers

This commit is contained in:
Nikolay Kim
2017-12-04 14:53:40 -08:00
parent f5d6179a34
commit e332c1242f
16 changed files with 61 additions and 80 deletions

View File

@ -32,7 +32,7 @@ extern crate actix_web;
fn main() {
actix_web::Application::default("/")
.route("/static", actix_web::fs::StaticFiles::new(".", true))
.route("/static", |r| r.h(actix_web::fs::StaticFiles::new(".", true)))
.finish();
}
```

View File

@ -18,7 +18,7 @@ fn index(req: HttpRequest) -> HttpResponse {
fn main() {
Application::default("/")
.handler("/prefix", index)
.route("/prefix", |r| r.f(index))
.finish();
}
```
@ -37,7 +37,7 @@ fn index(req: HttpRequest) -> HttpResponse {
fn main() {
Application::default("/app")
.handler("/prefix", index)
.route("/prefix", |r| r.f(index))
.finish();
}
```