Created
November 29, 2017 18:12
-
-
Save davideicardi/dd40e83b05598da44ec0e1cb9b051c73 to your computer and use it in GitHub Desktop.
Stupid node.js utility that capture and print any http request
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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