Skip to content

Instantly share code, notes, and snippets.

@jondlm jondlm/express-headers.js
Last active Apr 25, 2017

Embed
What would you like to do?
A little node server that logs the most recent request and response headers
const express = require('express')
const app = express()
const util = require('util')
app.get('*', function (req, res) {
process.stdout.write('\033c')
console.log('Request headers:')
console.log(util.inspect(req.headers, { colors: true }))
res.send('test')
console.log('\nResponse headers:')
console.log(util.inspect(res.header()._headers, { colors: true }))
})
app.listen(9876, function () {
console.log('Listening on port 9876')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.