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 (isServerSide) { | |
return 'http' | |
} | |
if (service === 'webclient' || environment !== 'local') { | |
return 'https' | |
} | |
return 'http' |
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' || | |
(service !== 'webclient' && environment !== 'local')) { | |
return 'https' | |
} | |
... | |
} |
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 (isServerSide) { | |
return 'http' | |
} | |
if (service === 'webclient') { | |
return 'https' | |
} | |
if (service !== 'webclient' && environment !== 'local') { |
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' |
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
Service is Webclient | Server Side | Env is Local | Returns | |
---|---|---|---|---|
TRUE | TRUE | TRUE | http | |
TRUE | TRUE | FALSE | http | |
TRUE | FALSE | TRUE | https | |
TRUE | FALSE | FALSE | https | |
FALSE | TRUE | TRUE | http | |
FALSE | FALSE | TRUE | http | |
FALSE | TRUE | FALSE | http | |
FALSE | FALSE | FALSE | https |
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
Service is Webclient | Server Side | Env is Local | Returns | |
---|---|---|---|---|
TRUE | TRUE | - | http | |
TRUE | FALSE | - | https | |
FALSE | - | TRUE | http | |
FALSE | TRUE | FALSE | http | |
FALSE | FALSE | FALSE | https |
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') { | |
if (isServerSide) { | |
return 'http' | |
} | |
return 'https' | |
} else { | |
if (environment === 'local') { | |
return 'http' |
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 (isServerSide) { | |
return 'http' | |
} | |
if (service === 'webclient' || environment !== 'local') { | |
return 'https' | |
} | |
return 'http' |
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}` | |
} |
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
-------------------|----------|----------|----------|----------|-------------------| | |
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s | | |
-------------------|----------|----------|----------|----------|-------------------| | |
... | ... | ... | ... | ... | ...| | |
endpoint.js | 100 | 100 | 100 | 100 | | | |
... | ... | ... | ... | ... | ...| | |
-------------------|----------|----------|----------|----------|-------------------| | |
Test Suites: 1 passed, 1 total | |
Tests: 12 passed, 12 total |
NewerOlder