Operation System
-This web root is a placeholder for the operation-system app skeleton.
-diff --git a/crates/app_operation_system/src/router.rs b/crates/app_operation_system/src/router.rs index 9b63112..8f8ab08 100644 --- a/crates/app_operation_system/src/router.rs +++ b/crates/app_operation_system/src/router.rs @@ -3,14 +3,30 @@ use tower_http::services::ServeDir; use crate::app::AppState; -const WEB_ROOT: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/web"); +async fn no_cache( + req: axum::extract::Request, + next: axum::middleware::Next, +) -> axum::response::Response { + let mut response = next.run(req).await; + response.headers_mut().insert( + axum::http::header::CACHE_CONTROL, + axum::http::HeaderValue::from_static("no-store"), + ); + response +} pub fn build_router(state: AppState) -> Router { Router::new() .route("/api/health", get(health_check)) - .nest_service( + .nest( "/ui", - ServeDir::new(WEB_ROOT).append_index_html_on_directories(true), + Router::new() + .fallback_service( + ServeDir::new("web/ops") + .append_index_html_on_directories(true) + .fallback(ServeDir::new("web/core")), + ) + .layer(axum::middleware::from_fn(no_cache)), ) .with_state(state) } diff --git a/crates/app_operation_system/web/index.html b/crates/app_operation_system/web/index.html deleted file mode 100644 index 1471a65..0000000 --- a/crates/app_operation_system/web/index.html +++ /dev/null @@ -1,14 +0,0 @@ - - -
- - -This web root is a placeholder for the operation-system app skeleton.
-${error.message || String(error)}`;
+});