How to parameterize middleware with route specific values #102
Unanswered
danielnelson
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a metrics middleware that I want to use for all routes, but its needs access to some route specific strings. I've come up with this method using a closure to capture the extra parameters, but I'm not very satisfied with how it looks. I need to repeat the route, and the closure syntax is not easy to read.
Does anyone have a suggestion for how to improve?
I think what would be ideal is something more like the middleware function objects in Tide, they also have the concept of the current route so you can do something like:
Beta Was this translation helpful? Give feedback.
All reactions