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

simplify application creation

This commit is contained in:
Nikolay Kim
2017-12-06 11:00:39 -08:00
parent 87c7441f7d
commit c63f058647
26 changed files with 150 additions and 138 deletions

View File

@@ -16,7 +16,7 @@ fn index(req: HttpRequest) -> Result<fs::NamedFile> {
}
fn main() {
Application::default("/")
Application::new("/")
.resource(r"/a/{tail:.*}", |r| r.method(Method::GET).f(index))
.finish();
}
@@ -32,7 +32,7 @@ To serve files from specific directory and sub-directories `StaticFiles` could b
use actix_web::*;
fn main() {
Application::default("/")
Application::new("/")
.resource("/static", |r| r.h(fs::StaticFiles::new(".", true)))
.finish();
}