Closed cornejong closed 5 months ago
I really like this change - I foresee some good use cases in middleware or anything that handles multiple routes. Thanks for the contribution!
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 81.35%. Comparing base (
7d9a6f7
) to head (40d0f3c
). Report is 7 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Thanks for the merge! Always happy to contribute.
What type of PR is this? (check all applicable)
Description
Named routes are great, and being able to retrieve the URL for a route based on its name is a feature I use a lot. However, when handlers reside in a different package from the router instance, this can become cumbersome. Therefore, it would be great if we could fetch the current router just like we can fetch the current route. This PR adds that functionality.
By default, the router is added to the request context but can be omitted using the
omitRouterFromContext
option or by callingrouter.OmitRouterFromContext(true)
.Related Tickets & Documents
Added/updated tests?
Run verifications and test
make verify
is passingmake test
is passing