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";