Files
YANPM/apps/api/src/routes/api.rs
GW_MC bbc6977e73
Some checks failed
Test / verify-generated-code (pull_request) Successful in 56s
Test / test-frontend (pull_request) Successful in 22s
Test / frontend-build (pull_request) Successful in 24s
Test / test (pull_request) Successful in 1m14s
Test / lint (pull_request) Failing after 1m13s
Add health check routes and state management
2025-12-05 14:05:09 +08:00

15 lines
431 B
Rust

mod health;
use axum::{Router, response::IntoResponse, routing::any};
pub fn get_api_router() -> Router {
Router::new()
.nest("/health", health::get_health_router())
// explicit fallback for unmatched API routes
.route("/{*wildcard}", any(api_fallback_handler))
}
async fn api_fallback_handler() -> impl IntoResponse {
(axum::http::StatusCode::NOT_FOUND, "API route not found").into_response()
}