%PDF- %PDF-
Direktori : /home/emergentqj/actioncivile/pre-auth/.f81b4c9eb38fd76cdf20462cf2027aa3/static/js/utils/ |
Current File : /home/emergentqj/actioncivile/pre-auth/.f81b4c9eb38fd76cdf20462cf2027aa3/static/js/utils/getEnvConstant.js |
import appEnvs from "config/appEnvs"; import isDomEnabled from "./isDomEnabled"; const { NODE_ENV } = process.env; export default function getEnvConstant() { const envs = appEnvs; // eslint-disable-next-line func-names const getEnv = function (fallbackEnv) { if (isDomEnabled) { const hostName = window.location.hostname; for (const key in envs) { if (Object.prototype.hasOwnProperty.call(envs, key)) { if (envs[key].indexOf(hostName) > -1) return key; } } } else { if (NODE_ENV === "production") { return "production"; } if (NODE_ENV === "staging") { return "staging"; } return "develop"; } return fallbackEnv; }; return getEnv("production"); }