Repository URL to install this package:
|
Version:
1.2.8 ▾
|
/* eslint-disable max-statements */
function getEnvVariable(name, fallback) {
return process.env[name] || process.env[name.toUpperCase()] || fallback
}
function getApiUrl() {
// we want to use the direct value, so it gets code replaced
const ENV_API_VALUE = process.env.API_URL || getEnvVariable('API_URL', '')
return ENV_API_VALUE === '""' ? '' : ENV_API_VALUE
}
function getAbsoluteUrl() {
const SERVER_URL = process.env.SERVER_URL
return getEnvVariable('SERVER_URL', SERVER_URL)
}
function getProxyUrl() {
const API_URL = getApiUrl()
return API_URL
}
export { getAbsoluteUrl, getEnvVariable, getProxyUrl }