Built motion from commit b983a9c.|0.0.141
authorDaniele Cinti <daniele.cinti@xcally.com>
Mon, 12 Sep 2016 09:18:08 +0000 (11:18 +0200)
committerDaniele Cinti <daniele.cinti@xcally.com>
Mon, 12 Sep 2016 09:18:08 +0000 (11:18 +0200)
server/app.js

index 1aec51a..5ac497a 100644 (file)
@@ -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);
 }