Created
December 6, 2019 15:07
-
-
Save D7Torres/238171803c1b38d970dfb5651de1e8c6 to your computer and use it in GitHub Desktop.
Endpoint Refactor - endpoint function final result
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
... | |
function endpoint(service, version = '') { | |
const protocol = getProtocol(service, __SERVER__, __ENV__) | |
const subdomain = getSubdomain(service, __SERVER__, __ENV__) | |
const path = getPath(service, __SERVER__, __ENV__, version) | |
const port = getPort(service, __ENV__, __CLIENT__) | |
return `${protocol}://${subdomain}.${__DOMAIN__}${port}${path}` | |
} | |
export default endpoint |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment