mirror of
https://github.com/fafhrd91/actix-web
synced 2025-09-02 01:31:57 +02:00
introduce route predicates
This commit is contained in:
@@ -78,8 +78,8 @@ fn main() {
|
||||
|
||||
HttpServer::new(
|
||||
Application::default("/")
|
||||
.resource("/", |r| r.handler(
|
||||
Method::GET, |req| {MyObj{name: "user".to_owned()}})))
|
||||
.resource("/", |r| r.method(
|
||||
Method::GET).handler(|req| {MyObj{name: "user".to_owned()}})))
|
||||
.serve::<_, ()>("127.0.0.1:8088").unwrap();
|
||||
|
||||
println!("Started http server: 127.0.0.1:8088");
|
||||
|
Reference in New Issue
Block a user