Skip to content

Instantly share code, notes, and snippets.

Last active Apr 25, 2017
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) {
console.log('Request headers:')
console.log(util.inspect(req.headers, { colors: true }))
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