Skip to content
This repository has been archived by the owner on Jan 12, 2022. It is now read-only.

Add express middleware support for sub-routers #55

Merged
merged 1 commit into from
Mar 17, 2016
Merged

Add express middleware support for sub-routers #55

merged 1 commit into from
Mar 17, 2016

Conversation

dlebech
Copy link
Contributor

@dlebech dlebech commented Mar 11, 2016

This PR pre-pends req.baseUrl to the default StatsD key for the express middleware when timeByUrl is true. This allows express "mini-applications" and makes sure that the url "/subrouter/foo" and
"/foo" get distinct StatsD keys when "/subrouter" is an express "mini-application".

Changes:

  • Add req.baseUrl to express middleware StatsD key.
  • Add express tests.

Express documentation: http://expressjs.com/en/4x/api.html#router

This commit pre-pends req.baseUrl to the default StatsD key for the
express middleware when timeByUrl is true. This allows express
"mini-applications" and makes sure that the url "/subrouter/foo" and
"/foo" get distinct StatsD keys when "/subrouter" is an express
"mini-application"

Changes:
- Add req.baseUrl to express middleware StatsD key.
- Add express tests.
@msiebuhr
Copy link
Owner

Good catch. And very nice with the tests too!

msiebuhr added a commit that referenced this pull request Mar 17, 2016
Add express middleware support for sub-routers
@msiebuhr msiebuhr merged commit 6c22c8c into msiebuhr:master Mar 17, 2016
@msiebuhr
Copy link
Owner

Published in v0.2.2

@dlebech
Copy link
Contributor Author

dlebech commented Mar 17, 2016

Thanks 😃

@dlebech dlebech deleted the express-helper-base-url branch March 17, 2016 09:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants