Allow CORS to the local-api

This commit is contained in:
Herbert Wolverson 2024-07-27 08:10:49 -05:00
parent f37c95612e
commit a73e3af50a
2 changed files with 3 additions and 1 deletions

View File

@ -39,7 +39,7 @@ zerocopy = { workspace = true }
fxhash = "0.2.1"
axum = { version = "0.7.5", features = ["ws", "http2"] }
axum-extra = { version = "0.9.3", features = ["cookie", "cookie-private"] }
tower-http = { version = "0.5.2", features = ["fs"] }
tower-http = { version = "0.5.2", features = ["fs", "cors"] }
strum = { version = "0.26.3", features = ["derive"] }
default-net = { workspace = true }
surge-ping = "0.8.1"

View File

@ -18,9 +18,11 @@ mod flow_explorer;
use axum::Router;
use axum::routing::{get, post};
use crate::node_manager::auth::auth_layer;
use tower_http::cors::CorsLayer;
pub fn local_api() -> Router {
Router::new()
.layer(CorsLayer::very_permissive())
.route("/dashletThemes", get(dashboard_themes::list_themes))
.route("/dashletSave", post(dashboard_themes::save_theme))
.route("/dashletDelete", post(dashboard_themes::delete_theme))