refactor: make /v1/health accept GET requests (#527)
parent
3eb5f4132c
commit
24eadf0de8
|
|
@ -92,7 +92,7 @@ impl Version {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[utoipa::path(
|
#[utoipa::path(
|
||||||
post,
|
get,
|
||||||
path = "/v1/health",
|
path = "/v1/health",
|
||||||
tag = "v1",
|
tag = "v1",
|
||||||
responses(
|
responses(
|
||||||
|
|
|
||||||
|
|
@ -201,11 +201,17 @@ fn api_router(args: &ServeArgs) -> Router {
|
||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let health_state = Arc::new(health::HealthState::new(args));
|
||||||
let router = Router::new()
|
let router = Router::new()
|
||||||
.route("/v1/events", routing::post(events::log_event))
|
.route("/v1/events", routing::post(events::log_event))
|
||||||
|
/* Remove POST /v1/health route in next major version release. */
|
||||||
.route(
|
.route(
|
||||||
"/v1/health",
|
"/v1/health",
|
||||||
routing::post(health::health).with_state(Arc::new(health::HealthState::new(args))),
|
routing::post(health::health).with_state(health_state.clone()),
|
||||||
|
)
|
||||||
|
.route(
|
||||||
|
"/v1/health",
|
||||||
|
routing::get(health::health).with_state(health_state),
|
||||||
)
|
)
|
||||||
.route(
|
.route(
|
||||||
"/v1/completions",
|
"/v1/completions",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue