From b4ec8ac983af534de1c243a289e63de2c23712d0 Mon Sep 17 00:00:00 2001 From: Arthur Belleville Date: Mon, 14 Jul 2025 16:59:17 +0200 Subject: [PATCH] Add staging to CORS --- api/src/config.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/api/src/config.ts b/api/src/config.ts index 9ae4334..c0d57b4 100644 --- a/api/src/config.ts +++ b/api/src/config.ts @@ -1,7 +1,7 @@ import dotenv from "dotenv"; export interface AppConfig { - NODE_ENV: "development" | "production" | "test"; + NODE_ENV: "development" | "production" | "test" | "staging"; PORT: number; FRONTEND_URL: string; SUPABASE_URL: string; @@ -28,6 +28,7 @@ function createConfig(): AppConfig { const NODE_ENV = (process.env.NODE_ENV || "development") as | "development" | "production" + | "staging" | "test"; // Base configuration @@ -64,10 +65,12 @@ function createConfig(): AppConfig { "http://127.0.0.1:3000", ]; baseConfig.LOG_LEVEL = "debug"; + } else if (NODE_ENV === "staging") { + baseConfig.CORS_ORIGIN = ["https://app-staging.xtablo.com"]; } else if (NODE_ENV === "production") { baseConfig.CORS_ORIGIN = [ baseConfig.FRONTEND_URL, - "https://xtablo.com", + "https://app.xtablo.com", "https://develop.xtablo-source.pages.dev", ]; baseConfig.LOG_LEVEL = "info";