Implement frontend routing and API fallback handling; add dependencies for include_dir and mime_guess
Some checks failed
Test / verify-generated-code (pull_request) Successful in 7m59s
Test / test (pull_request) Failing after 1m12s
Test / lint (pull_request) Failing after 1m11s

This commit is contained in:
GW_MC
2025-12-02 19:25:46 +08:00
parent 27173c01da
commit edbcdaeff4
5 changed files with 149 additions and 1 deletions

View 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()
}