expressjs / response-time

Response time header for node.js
MIT License
472 stars 73 forks source link

Custom header support #3

Closed RafLeszczynski closed 10 years ago

RafLeszczynski commented 10 years ago

Hello, I would like to use response-time middleware for measuring service backend response time for Wikia Interactive Maps. Unfortunately our performance measuring tool in Wikia require X-Backend-Response-Time. I've added additional param which allows for setting other header than default X-Response-Time.

dougwilson commented 10 years ago

Hi! I will certainly add custom header support :) I left you some notes above for changes to make to your PR. You are not required to make them, but doing them will help speed the PR along to inclusion faster :)

RafLeszczynski commented 10 years ago

Thank you. I'll address all comments tomorrow :-)

dougwilson commented 10 years ago

I'll address all comments tomorrow

Haha :) Check this PR before you do, then, because my day just started and I'll probably have had the time to do them for you and you may wake up to a new version of this library with custom header support! \m/

dougwilson commented 10 years ago

@RafLeszczynski when you get around to it, please give me feedback on the implementation. At this time, it's not yet published, so you can test it out with

$ npm install expressjs/response-time

and then

app.use(responseTime({ header: 'X-Backend-Response-Time' }))
dougwilson commented 10 years ago

So I went ahead and released this as 2.1.0. Simple use this module as the following with 2.1.0:

app.use(responseTime({ header: 'X-Backend-Response-Time' }))
RafLeszczynski commented 10 years ago

Thank you a lot :-)