X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fskyquake.js;h=9b52e96eb3d7098127ea4b79bacb8def7022fc23;hp=0e597d905fdaa6cbc87426b2867d6843137d5a80;hb=refs%2Fheads%2Fpm_phase2;hpb=e29efc315df33d546237e270470916e26df391d6 diff --git a/skyquake/skyquake.js b/skyquake/skyquake.js index 0e597d905..9b52e96eb 100644 --- a/skyquake/skyquake.js +++ b/skyquake/skyquake.js @@ -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); @@ -238,6 +248,13 @@ if (cluster.isMaster && clusteredLaunch) { app.get('/multiplex-client', function(req, res) { res.sendFile(__dirname + '/node_modules/websocket-multiplex/multiplex_client.js'); }); + + // handle requests for gzip'd files + app.get('*gzip*', function (req, res, next) { + res.set('Content-Encoding', 'gzip'); + next(); + }); + } /**