diff --git a/lib/roles/app.js b/lib/roles/app.js index 7e1ed42e..2b6e1b7c 100644 --- a/lib/roles/app.js +++ b/lib/roles/app.js @@ -84,8 +84,10 @@ module.exports = function(options) { })) // Variables for templates - app.locals.APP = { - websocketUrl: options.websocketUrl + app.locals.APPSTATE = { + config: { + websocketUrl: options.websocketUrl + } } // Proxied requests must come before any body parsers. These proxies are diff --git a/res/app/components/stf/socket/socket-service.js b/res/app/components/stf/socket/socket-service.js index 8e473464..2b620703 100644 --- a/res/app/components/stf/socket/socket-service.js +++ b/res/app/components/stf/socket/socket-service.js @@ -1,9 +1,9 @@ var io = require('socket.io') module.exports = function SocketFactory($rootScope, VersionUpdateService) { - /*globals APP:false*/ + /*globals APPSTATE:false*/ - var socket = io(APP.websocketUrl, { + var socket = io(APPSTATE.config.websocketUrl, { reconnection: false , transports: ['websocket'] }) diff --git a/res/app/views/index.jade b/res/app/views/index.jade index 6c7002f0..b0dd6a65 100644 --- a/res/app/views/index.jade +++ b/res/app/views/index.jade @@ -22,7 +22,7 @@ html div(growl) div(ng-view).fill-height - script var APP = !{JSON.stringify(APP)} + script var APPSTATE = !{JSON.stringify(APPSTATE)} script(src='/static/build/entry/commons.entry.js') script(src='/static/build/entry/app.entry.js') script(src='/static/bower_components/stf-analytics/analytics.js')