X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fframework%2Fcore%2Fapi_utils%2Futils.js;fp=skyquake%2Fframework%2Fcore%2Fapi_utils%2Futils.js;h=5b17279d5af68b95f64ff237d24ebfe6972ce483;hp=0d1990c64a097306ef1eb68c7de0b049a39a4786;hb=13f32c0c3cbad3b1d70d20342f44c65328c91ec9;hpb=df332f582aae48baaf5b1fa51c15f3bf0bab0443 diff --git a/skyquake/framework/core/api_utils/utils.js b/skyquake/framework/core/api_utils/utils.js index 0d1990c64..5b17279d5 100644 --- a/skyquake/framework/core/api_utils/utils.js +++ b/skyquake/framework/core/api_utils/utils.js @@ -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 };