diff --git a/bin/core/src/main.rs b/bin/core/src/main.rs index 0b87eb14a..f798bb9cd 100644 --- a/bin/core/src/main.rs +++ b/bin/core/src/main.rs @@ -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) diff --git a/bin/core/src/ts_client.rs b/bin/core/src/ts_client.rs index 7f15092ce..187d1c74f 100644 --- a/bin/core/src/ts_client.rs +++ b/bin/core/src/ts_client.rs @@ -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] = &[