Browse Source

mongo tail

master
zeus 4 years ago
parent
commit
ad35672f84
  1. 3
      swarmlab-app/src/package.json
  2. 8
      swarmlab-app/src/run/app.js

3
swarmlab-app/src/package.json

@ -14,6 +14,9 @@
"chai": "^4.2.0", "chai": "^4.2.0",
"cors": "^2.8.5", "cors": "^2.8.5",
"dirty-chai": "^2.0.1", "dirty-chai": "^2.0.1",
"socket.io-redis": "^6.0.1",
"redis": "^3.0.0",
"socket.io-adapter": "~2.0.0",
"express": "^4.17.1", "express": "^4.17.1",
"express-validator": "^6.6.1", "express-validator": "^6.6.1",
"helmet": "^4.1.1", "helmet": "^4.1.1",

8
swarmlab-app/src/run/app.js

@ -6,6 +6,14 @@ var http = require('http').Server(app);
var https = require('https'); var https = require('https');
var io = require('socket.io')(http); var io = require('socket.io')(http);
import { createAdapter } from 'socket.io-redis';
import { RedisClient } from 'redis';
const pubClient = new RedisClient({ host: 'localhost', port: 6379 });
const subClient = pubClient.duplicate();
io.adapter(createAdapter({ pubClient, subClient }));
const MongoClient = require('mongodb').MongoClient; const MongoClient = require('mongodb').MongoClient;
//var chokidar = require("chokidar"); //var chokidar = require("chokidar");

Loading…
Cancel
Save