New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

super-simple-web-server

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

super-simple-web-server - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

28

index.js

@@ -27,2 +27,28 @@ const express = require('express');

//Runs every time a request is recieved
function logger(req, res, next) {
console.log('Request from: ', req.path); //Log the request to the console
next(); //Run the next handler (IMPORTANT, otherwise your page won't be served)
}
/**
* To add middleware set the third arg to a path that resolves to a file exporting a function like so...
* module.exports = (app) => { app.use(someCoolThingHere);}
*/
const MIDDLEWARE_PATH = path.resolve(process.argv[3] || false);
if (MIDDLEWARE_PATH) {
try {
var initMiddleware = require(MIDDLEWARE_PATH);
initMiddleware(app);
} catch (err) {
console.log('Error initalizing middleware. ', err);
}
} else {
console.log('No middleware found.');
}
app.use(logger);
app.use(express.static(ROOT_DIR));
console.log('\n---------------');

@@ -33,4 +59,2 @@ console.log('Starting static hosts with root: ' + ROOT_DIR);

app.use(express.static(ROOT_DIR));
app.listen(HTTP_PORT, (err) => {

@@ -37,0 +61,0 @@ if (err) {

2

package.json

@@ -11,3 +11,3 @@ {

"name": "super-simple-web-server",
"version": "1.1.1"
"version": "1.1.2"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc