RafalWilinski / express-status-monitor

🚀 Realtime Monitoring solution for Node.js/Express.js apps, inspired by status.github.com, sponsored by https://dynobase.dev
https://dynobase.dev/
MIT License
3.61k stars 255 forks source link

supporting namespace #145

Open arily opened 4 years ago

arily commented 4 years ago

my project uses socketIO and uses default namespace, so every client are constantly receiving status or I have to create another socket for the monitor.

instead of

const app = express();

const server = require('http').Server(app);
const io = require('socket.io')(server);

const statusSocket = require('socket.io')(server,{
    path: '/statusSocket'
});
app.use(require('express-status-monitor')({
    socketPath: '/statusSocket',
    websocket: statusSocket,
}));

it will be better to support custom namespace

const app = express();

const server = require('http').Server(app);
const io = require('socket.io')(server);
app.use(require('express-status-monitor')({
    namespace: '/status',
    websocket: io.of('/status'),
}));