Skip to content

Instantly share code, notes, and snippets.

@andreferi3
Created May 4, 2020 05:40
Show Gist options
  • Select an option

  • Save andreferi3/619fc3f803e876e40e026edacad7c2f4 to your computer and use it in GitHub Desktop.

Select an option

Save andreferi3/619fc3f803e876e40e026edacad7c2f4 to your computer and use it in GitHub Desktop.
function getApiUrl(releaseChannel) {
if (releaseChannel === undefined) return App.apiUrl.dev // since releaseChannels are undefined in dev, return your default.
if (releaseChannel.indexOf('prod') !== -1) return App.apiUrl.prod // this would pick up prod-v1, prod-v2, prod-v3
if (releaseChannel.indexOf('staging') !== -1) return App.apiUrl.staging // return staging environment variables
}
// source : https://github.com/expo/expo/issues/7857
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment