Koa 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 receivedx-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 koa-latency-headers --save
var koa = var app = // Latency Header Middlewarevar latency = // Set the x-request-received headerapp // Send the response bodyapp // Listen for incoming requestsapp