fix(control-api): enable CORS to allow UI access
Some checks failed
ci / ui (push) Failing after 31s
images / build-and-push (push) Failing after 19s
ci / rust (push) Failing after 2m42s

This commit is contained in:
2026-03-30 21:52:00 +03:00
parent 63ca237178
commit 020ebad570
2 changed files with 7 additions and 1 deletions

View File

@@ -113,6 +113,11 @@ pub fn build_app(state: AppState) -> Router {
.merge(documents::router())
.layer(from_fn_with_state(state.clone(), auth::auth_middleware));
let cors = tower_http::cors::CorsLayer::new()
.allow_origin(tower_http::cors::Any)
.allow_methods(tower_http::cors::Any)
.allow_headers(tower_http::cors::Any);
Router::new()
.route("/health", get(health))
.route("/ready", get(ready))
@@ -123,6 +128,7 @@ pub fn build_app(state: AppState) -> Router {
)
.nest("/admin/v1", admin)
.with_state(state)
.layer(cors)
.layer(trace)
.layer(from_fn(request_id_middleware))
}