Merge "Merge branch 'master' of https://osm.etsi.org/gerrit/osm/UI"
[osm/UI.git] / skyquake / skyquake.js
index 0e597d9..726757f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 
+ *
  *   Copyright 2016 RIFT.IO Inc
  *
  *   Licensed under the Apache License, Version 2.0 (the "License");
@@ -83,6 +83,9 @@ if (cluster.isMaster && clusteredLaunch) {
 
        var sslOptions = null;
 
+       var apiServer = argv['api-server'] ? argv['api-server'] : 'localhost';
+       var uploadServer = argv['upload-server'] ? argv['upload-server'] : null;
+
        try {
                if (argv['enable-https']) {
                        var keyFilePath = argv['keyfile-path'];
@@ -194,9 +197,16 @@ if (cluster.isMaster && clusteredLaunch) {
                app.use(inactivity_routes);
 
                // Configure global config with ssl enabled/disabled
-               configurationAPI.globalConfiguration.update({
-                       ssl_enabled: httpsConfigured
-               });
+               var globalConfig = {
+                       ssl_enabled: httpsConfigured,
+                       api_server: apiServer
+               };
+
+               if (uploadServer) {
+                       globalConfig.upload_server = uploadServer;
+               }
+
+               configurationAPI.globalConfiguration.update(globalConfig);
 
                // Configure configuration route(s)
                app.use(configuration_routes);