Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@umputun
Copy link
Member

@umputun umputun commented Mar 13, 2024

See #7

The PR adds an automatic registration of NotFoundHandler as a catch-all route, which is invoked when no other route matches the request. This handler is wrapped with all the middlewares associated with the group. This functionality is beneficial for applying middleware to all routes, including unknown ones. It enables the use of middlewares that should operate across all routes, such as logging.

If you want to disable this behavior, use the DisableNotFoundHandler() function.

umputun added 4 commits March 12, 2024 03:39
This update introduces root handling functionality to the group routing. Now, if no root route ("/") is registered, a not found handler is automatically registered for the root route. This helps in utilizing middleware for all routes such as logging. Additionally, the middleware wrapping process has been refactored into a separate function to streamline the code and improve readability. The update also includes related tests and minor tweaks to existing tests. #7
@umputun umputun merged commit 6978eff into master Mar 13, 2024
@umputun umputun deleted the catch-all branch March 13, 2024 04:56
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.

2 participants