Skip to content

Commit

Permalink
Adding check for stage environment
Browse files Browse the repository at this point in the history
  • Loading branch information
parahall authored Jul 20, 2023
1 parent a300caf commit f24877d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ function isNodeEnv() {
return typeof process !== "undefined";
}

function isNodeDevEnv() {
return isNodeEnv() && process.env.NODE_ENV === "development";
function isNodeDevStageEnv() {
return isNodeEnv() && (process.env.NODE_ENV === "development" || process.env.NODE_ENV === "staging");
}

const getEnvOrDefault = (key, defaultVal) => {
return isNodeDevEnv() && process.env[key] !== "undefined" ? process.env[key] : defaultVal;
return isNodeDevStageEnv() && process.env[key] !== "undefined" ? process.env[key] : defaultVal;
};

const MONDAY_PROTOCOL = () => getEnvOrDefault("MONDAY_COM_PROTOCOL", "https");
Expand Down

0 comments on commit f24877d

Please sign in to comment.