Last active
February 10, 2020 11:32
-
-
Save D7Torres/223c69adc7d022ee7b2b795abf006105 to your computer and use it in GitHub Desktop.
Endpoint Refactor - Simplified getProtocol()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const getProtocol = (service, isServerSide, environment) => { | |
if (service === 'webclient' && !isServerSide) { | |
return 'https' | |
} | |
if (service !== 'webclient' && !isServerSide && environment !== 'local') { | |
return 'https' | |
} | |
return 'http' | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment