@zendesk/zcli-themes
Version:
zcli theme commands live here
18 lines (17 loc) • 613 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getLocalServerBaseUrl = void 0;
function getLocalServerBaseUrl(flags, isWebsocket = false) {
const { bind: host, port } = flags;
return `${getProtocol(flags, isWebsocket)}://${host}:${port}`;
}
exports.getLocalServerBaseUrl = getLocalServerBaseUrl;
function getProtocol(flags, isWebsocket) {
const { 'https-cert': httpsCert, 'https-key': httpsKey } = flags;
if (isWebsocket) {
return httpsCert && httpsKey ? 'wss' : 'ws';
}
else {
return httpsCert && httpsKey ? 'https' : 'http';
}
}