Implement frontend routing and API fallback handling; add dependencies for include_dir and mime_guess
This commit is contained in:
11
apps/api/src/routes/api.rs
Normal file
11
apps/api/src/routes/api.rs
Normal file
@@ -0,0 +1,11 @@
|
||||
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()
|
||||
}
|
||||
Reference in New Issue
Block a user