1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-09-01 17:27:18 +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

@@ -16,7 +16,7 @@ fn index(req: HttpRequest) -> Result<fs::NamedFile> {
}
fn main() {
Application::new("/")
Application::new()
.resource(r"/a/{tail:.*}", |r| r.method(Method::GET).f(index))
.finish();
}
@@ -34,7 +34,7 @@ And this name has to be used in `StaticFile` constructor.
use actix_web::*;
fn main() {
Application::new("/")
Application::new()
.resource("/static/{tail:.*}", |r| r.h(fs::StaticFiles::new("tail", ".", true)))
.finish();
}