12 lines
364 B
Rust
12 lines
364 B
Rust
use axum::{Router, response::IntoResponse, routing::any};
|
|
|
|
pub fn get_api_router() -> Router {
|
|
Router::new()
|
|
// 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()
|
|
}
|