From 9473793e8c8b8fb81dca7d4adbce224db9aacaa2 Mon Sep 17 00:00:00 2001 From: Daniele Cinti Date: Mon, 12 Sep 2016 11:18:08 +0200 Subject: [PATCH] Built motion from commit b983a9c.|0.0.141 --- server/app.js | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-) 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); } -- 1.7.1