Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better support for Koa and other non-express frameworks... #8

Open
hairyhenderson opened this issue Mar 16, 2018 · 2 comments
Open
Labels
help wanted Extra attention is needed

Comments

@hairyhenderson
Copy link
Contributor

I'm personally not very familiar with frameworks other than express, but a number of colleagues have started to use Koa, and this module's dependency on the express module, and a few other factors, have prevented them from adopting this module directly.

I'd like to gather feedback on what the particular issues are, for example - apparently koa-connect may cause "issues", though it's unclear what those issues might be.

Ideally this module's dependency on express (or any other framework) should be optional.

I'm open to any comments that people have on this 🙂...

@hairyhenderson hairyhenderson added the help wanted Extra attention is needed label Mar 16, 2018
@peol
Copy link
Contributor

peol commented Mar 16, 2018

The express dependency right now is probably pretty easily removed, but it will likely come as a cost of people having to implement the middleware themselves. I don't think that is a problem though, it's a pretty common pattern that middelwares only deliver the middleware, and people bind it to their routes themselves.

Exposing this library as a "plain" middleware should likely work in most express-like scenarios (express, koa), but also exposing the metrics logic on its own as hooks would support the majority of other libraries (although, I think supporting express and koa likely covers a huge majority of use cases).

@hairyhenderson
Copy link
Contributor Author

I think #17 fixes any functional issues with using this middleware with Koa, though I think it may still be possible to remove the express dependency, or at least make it optional.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants