From: Daniele Cinti Date: Tue, 13 Sep 2016 12:57:05 +0000 (+0200) Subject: Built motion from commit 5daed3e.|0.0.141 X-Git-Tag: 20/10/16~81 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22javascript:;/%22?a=commitdiff_plain;h=60846a22221cdb64b8f3a794d19dd14a5ba4940c;p=motion.git Built motion from commit 5daed3e.|0.0.141 --- 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