Sha256: a7d321bb366241398ea2b58a77251fe3c38733c2459dcfc248a4d3aeef8f7a3c
Contents?: true
Size: 586 Bytes
Versions: 26
Compression:
Stored size: 586 Bytes
Contents
/*! * Ext JS Connect * Copyright(c) 2010 Sencha Inc. * MIT Licensed */ /** * Responds with the _X-Response-Time_ header in milliseconds. * * @return {Function} * @api public */ module.exports = function responseTime(){ return function responseTime(req, res, next){ var start = new Date, writeHead = res.writeHead; res.writeHead = function(code, headers){ res.writeHead = writeHead; headers['X-Response-Time'] = (new Date - start) + "ms"; res.writeHead(code, headers); }; next(); }; };
Version data entries
26 entries across 26 versions & 1 rubygems