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

Add the ability to store and retrieve the path template #7

Merged
merged 3 commits into from
Sep 12, 2024

Conversation

louieliu97
Copy link
Contributor

@louieliu97 louieliu97 commented Sep 12, 2024

Changes proposed by this PR

Adds a template field to the Route object which stores the initial template prior to the regex being applied. This is useful for documentation or metrics purposes to extract the template instead of the full route path. For example, a route with the template /users/:id can have this template retrieved when a request to /users/123 is sent.

closes #

  • Added template field to Route struct
  • Added CurrentRoute() and PathTemplate() functions
  • Add unit tests to maintain 100% code coverage

Notes to reviewer

@shellfu shellfu merged commit c54b427 into shellfu:main Sep 12, 2024
1 check passed
shellfu added a commit that referenced this pull request Jan 29, 2025
Add the ability to store and retrieve the path template
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants