Skip to content

Instantly share code, notes, and snippets.

@D7Torres
Last active December 20, 2019 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save D7Torres/5250413050dfd7ec96f0770981be31bc to your computer and use it in GitHub Desktop.
Save D7Torres/5250413050dfd7ec96f0770981be31bc to your computer and use it in GitHub Desktop.
Endpoint Refactor - Simplified getProtocol() v2
const getProtocol = (service, isServerSide, environment) => {
if (isServerSide) {
return 'http'
}
if (service === 'webclient') {
return 'https'
}
if (service !== 'webclient' && environment !== 'local') {
return 'https'
}
return 'http'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment