X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fframework%2Fcore%2Fapi_utils%2Futils.js;h=5b17279d5af68b95f64ff237d24ebfe6972ce483;hb=5c4722a7fb7e022971726d729e87b094ac891aee;hp=163769a981b7038bec09dad021e4e39b8c944a1f;hpb=e29efc315df33d546237e270470916e26df391d6;p=osm%2FUI.git diff --git a/skyquake/framework/core/api_utils/utils.js b/skyquake/framework/core/api_utils/utils.js index 163769a98..5b17279d5 100644 --- a/skyquake/framework/core/api_utils/utils.js +++ b/skyquake/framework/core/api_utils/utils.js @@ -1,5 +1,5 @@ /* - * + * * Copyright 2016 RIFT.IO Inc * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -217,6 +217,15 @@ var passThroughConstructor = function(app) { }); } +var getPortForProtocol = function(protocol) { + switch (protocol) { + case 'http': + return 8000; + case 'https': + return 8443; + } +} + module.exports = { /** * Ensure confd port is on api_server variable. @@ -233,5 +242,7 @@ module.exports = { sendSuccessResponse: sendSuccessResponse, - passThroughConstructor: passThroughConstructor + passThroughConstructor: passThroughConstructor, + + getPortForProtocol: getPortForProtocol };