From: Daniele Cinti Date: Mon, 12 Sep 2016 09:18:08 +0000 (+0200) Subject: Built motion from commit b983a9c.|0.0.141 X-Git-Tag: 20/10/16~86 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22thisimagedoesnotexist.png/%22javascript:;//%22https:?a=commitdiff_plain;h=9473793e8c8b8fb81dca7d4adbce224db9aacaa2;p=motion.git Built motion from commit b983a9c.|0.0.141 --- diff --git a/server/app.js b/server/app.js index 1aec51a..5ac497a 100644 --- a/server/app.js +++ b/server/app.js @@ -43,6 +43,18 @@ var sio_redis = require('socket.io-redis'); var app = express(); var server = http.createServer(app); +var io = require('socket.io')(server, { + serveClient: (config.env === 'production') ? false : true, + path: '/socket.io-client' +}); + +io.adapter(redis({ + host: config.ip, + port: 6379 +})); + +require('./config/socketio')(io, require('./services/dashboard')(io)); + if (!sticky.listen(server, config.port)) { // Master code server.once('listening', function() { @@ -106,17 +118,7 @@ if (!sticky.listen(server, config.port)) { } else { // Slave code - var io = require('socket.io')(server, { - serveClient: (config.env === 'production') ? false : true, - path: '/socket.io-client' - }); - - io.adapter(redis({ - host: config.ip, - port: 6379 - })); - require('./config/socketio')(io, require('./services/dashboard')(io)); require('./config/express')(app); require('./routes')(app, ami); }