From 3bd2e67957b669da6dfbce8e5ea5c61a8ff4dc95 Mon Sep 17 00:00:00 2001 From: 0xevolve Date: Wed, 7 Aug 2024 22:31:40 +0100 Subject: [PATCH] feat: add cors for admin dashboard --- src/routes.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/routes.rs b/src/routes.rs index f4e82ec..812678e 100644 --- a/src/routes.rs +++ b/src/routes.rs @@ -2,7 +2,7 @@ use axum::http::{HeaderValue, Method, StatusCode}; use axum::response::IntoResponse; use axum::routing::{get, post}; use axum::Router; -use tower_http::cors::CorsLayer; +use tower_http::cors::{Any, CorsLayer}; use crate::handlers::global::health::health_check; use crate::handlers::indexers::create_indexer::create_indexer; @@ -21,7 +21,8 @@ pub fn app_router(state: AppState) -> Router { .layer( CorsLayer::new() .allow_origin("http://localhost:3000".parse::().unwrap()) - .allow_methods([Method::GET]), + .allow_origin("http://admin-dashboard.dev.pragma.build/".parse::().unwrap()) + .allow_methods(Any), ) }