Add staging to CORS
This commit is contained in:
parent
0510010876
commit
b4ec8ac983
1 changed files with 5 additions and 2 deletions
|
|
@ -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";
|
||||
|
|
|
|||
Loading…
Reference in a new issue