Fixed server.js on local environments #19
@ -13,6 +13,7 @@ server.listen(port, function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Monitor websockets
|
// Monitor websockets
|
||||||
|
if (process.env.WEBSOCKET_MONITOR_USERNAME && process.env.WEBSOCKET_MONITOR_PASSWORD) {
|
||||||
instrument(io, {
|
instrument(io, {
|
||||||
auth: {
|
auth: {
|
||||||
type: "basic",
|
type: "basic",
|
||||||
@ -21,7 +22,12 @@ instrument(io, {
|
|||||||
},
|
},
|
||||||
serverId: `${require("os").hostname()}#${process.pid}`
|
serverId: `${require("os").hostname()}#${process.pid}`
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
instrument(io, {
|
||||||
|
auth: false,
|
||||||
|
serverId: `${require("os").hostname()}#${process.pid}`
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// Serve static files (html, css, js)
|
// Serve static files (html, css, js)
|
||||||
app.use(express.static(__dirname + '/../public'));
|
app.use(express.static(__dirname + '/../public'));
|
||||||
|
Loading…
Reference in New Issue
Block a user