fix: update fallback service to serve index.html for not found routes
This commit is contained in:
parent
7d85e5e4f6
commit
5610260120
@ -1,10 +1,13 @@
|
||||
use axum::Router;
|
||||
use tower_http::services::ServeDir;
|
||||
use tower_http::services::{ServeDir, ServeFile};
|
||||
|
||||
#[shuttle_runtime::main]
|
||||
#[allow(clippy::unused_async)]
|
||||
async fn main() -> shuttle_axum::ShuttleAxum {
|
||||
let router = Router::new().fallback_service(ServeDir::new("frontend/dist/frontend/browser"));
|
||||
let router = Router::new().fallback_service(
|
||||
ServeDir::new("frontend/dist/frontend/browser")
|
||||
.not_found_service(ServeFile::new("frontend/dist/frontend/browser/index.html")),
|
||||
);
|
||||
|
||||
Ok(router.into())
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user