-
i need to implement health check api to fit for different monitor bots (don't ask me why several monitors exists :( ) for instance: my question is, is it able to bind both routes (/health, and /hello) into one function? #[get("/hello")]
#[get("/health")]
async fn health() -> impl Responder {
HttpResponse::Ok().body("hello")
} or maybe #[get(vec!["/health", "/hello"])]
async fn health() -> impl Responder {
HttpResponse::Ok().body("hello")
} |
Beta Was this translation helpful? Give feedback.
Answered by
robjtede
Jan 26, 2021
Replies: 1 comment 1 reply
-
The macros don't support this currently. Use the manual routing methods. .service(web::resource("/hello").get(health))
.service(web::resource("/health").get(health)) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
godlockin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The macros don't support this currently. Use the manual routing methods.