Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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