From 60846a22221cdb64b8f3a794d19dd14a5ba4940c Mon Sep 17 00:00:00 2001 From: Daniele Cinti Date: Tue, 13 Sep 2016 14:57:05 +0200 Subject: [PATCH] Built motion from commit 5daed3e.|0.0.141 --- server/app.js | 25 ++++++++++++------------- 1 files changed, 12 insertions(+), 13 deletions(-) diff --git a/server/app.js b/server/app.js index 6d9b98b..980ee0d 100644 --- a/server/app.js +++ b/server/app.js @@ -30,7 +30,6 @@ var crypto = require('crypto'); var cronjob = require('cron').CronJob; var shelljs = require('shelljs/global'); var sticky = require('sticky-session'); -var redis = require('socket.io-redis'); var express = require('express'); var config = require('./config/environment'); @@ -42,18 +41,6 @@ var sio_redis = require('socket.io-redis'); var app = express(); var server = http.createServer(app); -var io = sio(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)) { console.log('master'); @@ -112,6 +99,18 @@ if (!sticky.listen(server, config.port)) { // Slave code require('./config/express')(app); require('./routes')(app); + + var io = sio(server, { + serveClient: (config.env === 'production') ? false : true, + path: '/socket.io-client' + }); + + io.adapter(sio_redis({ + host: config.ip, + port: 6379 + })); + + require('./config/socketio')(io, require('./services/dashboard')(io)); } // Expose app -- 1.7.1