feat(backend): add swagger-ui endpoint via utoipa
This commit is contained in:
@@ -1,9 +1,21 @@
|
||||
use axum::{Router, routing::get};
|
||||
use utoipa::OpenApi;
|
||||
|
||||
#[derive(OpenApi)]
|
||||
#[openapi(paths(health))]
|
||||
pub struct HealthApi;
|
||||
|
||||
pub fn routes_health() -> Router {
|
||||
Router::new().route("/health", get(health))
|
||||
}
|
||||
|
||||
/// Health check
|
||||
#[utoipa::path(
|
||||
get,
|
||||
path = "/health",
|
||||
tag = "health",
|
||||
responses((status = 200, description = "Service is healthy"))
|
||||
)]
|
||||
async fn health() -> &'static str {
|
||||
"up"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user