Last active
September 9, 2015 08:14
-
-
Save SindreSvendby/7520d03459752a312ae1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Dumps all headers | |
// My usages is to test what headers Cloudfront is setting. Used together with ngrok for me. | |
//start script: | |
// npm install | |
// node headers.js | |
var express = require('express'); | |
var app = express(); | |
app.get('/', function (req, res) { | |
console.log(req.headers); | |
res.send('Headers captured. Check log!'); | |
}); | |
var server = app.listen(process.env.PORT || 3000, function () { | |
var host = server.address().address; | |
var port = server.address().port; | |
console.log('Example app listening at http://%s:%s', host, port); | |
}); |
This file contains hidden or 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
{ | |
"name": "headers-dump", | |
"version": "1.0.0", | |
"description": "Dump all req.headers to console", | |
"main": "headers.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"keywords": [ | |
"headers" | |
], | |
"author": "Sindre Øye Svendby", | |
"license": "ISC", | |
"dependencies": { | |
"express": "^4.13.3" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment