Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions apps/backend/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,23 @@ const environmentVariables = {
LOG_LEVEL: process.env.LOG_LEVEL || "info",
LOG_FILE_SIZE: process.env.LOG_FILE_SIZE || 1,
EXPRESS_REQUEST_SIZE_LIMIT: process.env.EXPRESS_REQUEST_SIZE_LIMIT || "5mb",
CORS_WHITELIST: process.env.CORS_WHITELIST
? process.env.CORS_WHITELIST.split(",")
: [
CORS_WHITELIST: (() => {
if (process.env.CORS_WHITELIST) {
return process.env.CORS_WHITELIST.split(",");
}
if (env === "development") {
return [
"http://localhost:3000",
"http://localhost:5173",
"http://127.0.0.1:3000",
"http://127.0.0.1:3001",
"http://localhost:3001",
],
];
}
throw new Error(
"CORS_WHITELIST environment variable is required in non-development environments"
);
})(),
};
console.log("environment variables set-----------------------------");
console.log(environmentVariables);
Expand Down