feat: add /api/v1/health public endpoint
- Add public health routes at /api/v1/health, /api/v1/health/detailed, /api/v1/health/consistency - Make health functions and response types public - Public routes bypass auth middleware (unlike protected /api/v1/* routes)
This commit is contained in:
+9
-1
@@ -1,6 +1,7 @@
|
||||
use std::time::Duration;
|
||||
|
||||
use axum::Router;
|
||||
use axum::{Json, Router};
|
||||
use serde_json::json;
|
||||
use tokio::time::timeout;
|
||||
use tower_http::cors::{Any, CorsLayer};
|
||||
|
||||
@@ -15,6 +16,7 @@ use super::checkin_api;
|
||||
use super::docs;
|
||||
use super::files;
|
||||
use super::health;
|
||||
use super::health::{health, health_detailed, health_consistency};
|
||||
use super::identities;
|
||||
use super::identity_agent_api;
|
||||
use super::identity_api;
|
||||
@@ -134,8 +136,14 @@ pub async fn start_server(host: &str, port: u16) -> anyhow::Result<()> {
|
||||
.allow_methods(Any)
|
||||
.allow_headers(Any);
|
||||
|
||||
let public_health_routes = Router::new()
|
||||
.route("/api/v1/health", axum::routing::get(health))
|
||||
.route("/api/v1/health/detailed", axum::routing::get(health_detailed))
|
||||
.route("/api/v1/health/consistency", axum::routing::get(health_consistency));
|
||||
|
||||
let app = Router::new()
|
||||
.merge(auth::auth_routes())
|
||||
.merge(public_health_routes)
|
||||
.merge(health::health_routes())
|
||||
.merge(docs::doc_routes())
|
||||
.merge(protected_routes)
|
||||
|
||||
Reference in New Issue
Block a user