Skip to content

Instantly share code, notes, and snippets.

@davideicardi
Created November 29, 2017 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davideicardi/dd40e83b05598da44ec0e1cb9b051c73 to your computer and use it in GitHub Desktop.
Save davideicardi/dd40e83b05598da44ec0e1cb9b051c73 to your computer and use it in GitHub Desktop.
Stupid node.js utility that capture and print any http request
const express = require("express");
const app = express();
app.all("/*", (req, res) => {
console.log(`${req.method} ${req.originalUrl}`);
for (const h in req.headers) {
console.log(`\t ${h}:${req.headers[h]}`);
}
res.status(404).send();
});
app.listen(8585, (err) => {
if (err) {
console.error(err);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment