Resolving Bug 155
[osm/UI.git] / skyquake / framework / core / api_utils / utils.js
index 0d1990c..5b17279 100644 (file)
@@ -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
 };