response-time
response-time copied to clipboard
Add support for request-received middleware
The request-received middleware at https://github.com/cabinjs/request-received exposes a Symbol.for property, which this package could conditionally consume if interested (as opposed to just generating process.hrtime().
e.g. https://github.com/expressjs/response-time/blob/master/index.js#L53 would change from var startAt = process.hrtime() to var startAt = req[Symbol.for('request-received.startAt')] ? req[Symbol.for('request-received.startAt')] : process.hrtime()
@dougwilson see #20
Note that Symbol is not supported in v0.8 and v0.10, therefore I have changed engine and .travis.yml to support v0.12.0+
Note that I am open to moving request-received to expressjs organization if need be.
And/or if we could add these two Symbols internally to Express automatically?