Skip to content

Commit

Permalink
feat: add cors for admin dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
EvolveArt committed Aug 7, 2024
1 parent dede162 commit 3bd2e67
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -21,7 +21,8 @@ pub fn app_router(state: AppState) -> Router<AppState> {
.layer(
CorsLayer::new()
.allow_origin("http://localhost:3000".parse::<HeaderValue>().unwrap())
.allow_methods([Method::GET]),
.allow_origin("http://admin-dashboard.dev.pragma.build/".parse::<HeaderValue>().unwrap())
.allow_methods(Any),
)
}

Expand Down

0 comments on commit 3bd2e67

Please sign in to comment.