mirror of
https://github.com/fafhrd91/actix-web
synced 2025-06-25 22:49:21 +02:00
simplify application creation
This commit is contained in:
@ -3,7 +3,6 @@
|
||||
Actix web is a small, fast, down-to-earth, open source rust web framework.
|
||||
|
||||
```rust,ignore
|
||||
extern crate actix_web;
|
||||
use actix_web::*;
|
||||
|
||||
fn index(req: HttpRequest) -> String {
|
||||
@ -12,7 +11,7 @@ fn index(req: HttpRequest) -> String {
|
||||
|
||||
fn main() {
|
||||
HttpServer::new(
|
||||
Application::default("/")
|
||||
Application::new("/")
|
||||
.resource("/{name}", |r| r.method(Method::GET).f(index)))
|
||||
.serve::<_, ()>("127.0.0.1:8080");
|
||||
}
|
||||
|
Reference in New Issue
Block a user