Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
A Header Debugger I wrote in NodeJs
var express = require("express");
var fs = require("fs");
var app = express();"/", function(req, res){
var date =;
var fileName = "POST.json";
console.log("POST / @" + date);
fs.writeFile(fileName, JSON.stringify({ "HEADERS": req.headers}, undefined, 2), function fileWriteComplete(err){
console.log(" Error writing to file " + err);
} else{
console.log(" File saved " + fileName);
app.listen(3000, function(){
console.log("App listening on port 3000");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment