From 723680003d5e0900a550585f87345491f53692b5 Mon Sep 17 00:00:00 2001 From: zeus Date: Wed, 25 Nov 2020 01:26:11 +0200 Subject: [PATCH] redis --- swarmlab-app/src/run/app.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/swarmlab-app/src/run/app.js b/swarmlab-app/src/run/app.js index e27be4d..590f50f 100755 --- a/swarmlab-app/src/run/app.js +++ b/swarmlab-app/src/run/app.js @@ -6,10 +6,14 @@ var http = require('http').Server(app); var https = require('https'); var io = require('socket.io')(http); -import { createAdapter } from 'socket.io-redis'; -import { RedisClient } from 'redis'; - -const pubClient = new RedisClient({ host: 'localhost', port: 6379 }); +//import { createAdapter } from 'socket.io-redis'; +const createAdapter = require('socket.io-redis'); +//import { RedisClient } from 'redis'; +const RedisClient = require("redis"); +//const pubClient = redis.createClient({ host: 'localhost', port: 6379 } ); +const pubClient = redis.createClient(); + +//const pubClient = new RedisClient({ host: 'localhost', port: 6379 }); const subClient = pubClient.duplicate(); io.adapter(createAdapter({ pubClient, subClient }));