Replies: 1 comment 1 reply
-
async fn handler() -> impl Responder {
...
}
App::new()
.service(web::resource("/route1").route(web::get().to(handler)))
.service(web::resource("/route2").route(web::get().to(handler)))
// or
App::new()
.service(web::resource(["/route1", "/route2"]).route(web::get().to(handler))) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Overdash
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
So if I have a route like
how can I get this route to handle incoming traffic for
/hi
and/hello
(all throughGET
).Is this even possible yet? The only work around I can think of is copying a pasting the log in another
fn
that will handle a different pathBeta Was this translation helpful? Give feedback.
All reactions