index.js
function _getHostEnv (hostUrl) {
  if (hostUrl) {
    if (hostUrl.startsWith('https://www.kth')) {
      return 'prod'
    } else if (hostUrl.startsWith('https://www-r.referens.sys.kth') || hostUrl.startsWith('https://app-r.referens.sys.kth')) {
      return 'ref'
    } else if (hostUrl.startsWith('http://localhost')) {
      return 'dev'
    } else {
      return 'prod'
    }
  }
}
function _getHostEnv (hostUrl) {
  if (hostUrl) {
    if (hostUrl.startsWith('https://www.kth')) {
      return 'prod'
    } else if (hostUrl.startsWith('https://www-r.referens.sys.kth') || hostUrl.startsWith('https://app-r.referens.sys.kth')) {
      return 'ref'
    } else if (hostUrl.startsWith('http://localhost')) {
      return 'dev'
    } else {
      return 'prod'
    }
  }
}
function _getHostEnv ( hostUrl ) { if ( hostUrl ) { if ( hostUrl . startsWith ( 'https://www.kth' ) ) { return 'prod' } else if ( hostUrl . startsWith ( 'https://www-r.referens.sys.kth' ) || hostUrl . startsWith ( 'https://app-r.referens.sys.kth' ) ) { return 'ref' } else if ( hostUrl . startsWith ( 'http://localhost' ) ) { return 'dev' } else { return 'prod' } } }
Get the current environment from the given Host or Content Management Host.
@param {*} host the given host URL.
Get the current environment from the given Host or Content Management Host .