fix last axum updates

This commit is contained in:
mbecker20
2025-01-15 00:23:25 -08:00
parent b63f4cd972
commit 8bccadca08
2 changed files with 3 additions and 4 deletions

View File

@@ -66,7 +66,7 @@ async fn app() -> anyhow::Result<()> {
let frontend_path = &config.frontend_path;
let frontend_index =
ServeFile::new(format!("{frontend_path}/index.html"));
let serve_dir = ServeDir::new(frontend_path)
let serve_frontend = ServeDir::new(frontend_path)
.not_found_service(frontend_index.clone());
let app = Router::new()
@@ -78,8 +78,7 @@ async fn app() -> anyhow::Result<()> {
.nest("/listener", listener::router())
.nest("/ws", ws::router())
.nest("/client", ts_client::router())
.nest_service("/", serve_dir)
.fallback_service(frontend_index)
.fallback_service(serve_frontend)
.layer(
CorsLayer::new()
.allow_origin(Any)

View File

@@ -13,7 +13,7 @@ use tokio::fs;
use crate::config::core_config;
pub fn router() -> Router {
Router::new().route("/:path", get(serve_client_file))
Router::new().route("/{path}", get(serve_client_file))
}
const ALLOWED_FILES: &[&str] = &[