%PDF- %PDF-
Direktori : /home/emergentqj/actioncivile/pre-auth/.632e77b3fb93bc8da5b589b869bc0037/static/js/utils/ |
Current File : /home/emergentqj/actioncivile/pre-auth/.632e77b3fb93bc8da5b589b869bc0037/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"); }