express-status-monitor
Advanced tools
Comparing version 0.0.4 to 0.0.6
15
index.js
(function () { | ||
'use strict'; | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
@@ -66,3 +67,3 @@ const os = require('os'); | ||
const middlewareWrapper = (config) => { | ||
if (config === null || config === {} || config === undefined) { | ||
if (config === null || config === undefined) { | ||
config = defaultConfig; | ||
@@ -85,2 +86,12 @@ } | ||
fs.readFile(path.join(__dirname, 'index.html'), 'utf8', (err,data) => { | ||
if (err) throw new Error(err); | ||
var result = data.replace(/{{port}}/g, config.socketPort); | ||
fs.writeFile(path.join(__dirname, 'index.rendered.html'), result, 'utf8', (err) => { | ||
if (err) throw new Error(err); | ||
}); | ||
}); | ||
io.on('connection', (socket) => { | ||
@@ -101,3 +112,3 @@ socket.emit('start', config.spans); | ||
if (req.path === config.path) { | ||
res.sendFile(path.join(__dirname + '/index.html')); | ||
res.sendFile(path.join(__dirname + '/index.rendered.html')); | ||
} else { | ||
@@ -104,0 +115,0 @@ onHeaders(res, () => { |
{ | ||
"name": "express-status-monitor", | ||
"version": "0.0.4", | ||
"version": "0.0.6", | ||
"description": "Monitoring for Express-based Node applications", | ||
@@ -5,0 +5,0 @@ "main": "app.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15387
118
2