Skip to content

montanaflynn/express-latency-headers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Express Latency Header Middleware

This middleware adds two headers to the response.

  • x-request-received is set by the server with the timestamp of when the request was received
  • x-response-sent is set by the server with the timestamp of when the response was sent

More information on why to add these headers.

Example

npm install express-latency-headers --save
var express = require('express')
var latencyHeaders = require('express-latency-headers')
var app = express()

app.use(latencyHeaders())

app.use(function(req, res, next) {
  setTimeout(function(){
    res.send('Hello World!')
  },1000)
})

var server = app.listen(3000)

About

Express middleware to add HTTP headers for latency benchmarking

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published