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
Merge PR for #34, add or_else_any_method explicit handlers #46
Conversation
@fkettelhoit - if possible, it would be great to get your review on this to make sure it captures all of what you were aiming to have supported with your PR. |
Looks good! I was thinking a bit about how the (I think there is a larger issue at play here: How much should be handled directly in a single router vs. composing multiple routers? Thanks to the functional nature of the router, it is easy to map the result of one router and use another router for any 404 response, for example, which can already solve most catchall cases. But there is still value in providing an API that solves most common situations in a single router, in my opinion, because compositions of different routers are not always the most obvious solution. I would say that all in all the current PR strikes a good balance there.) |
Generalize `not_found` handler to handle arbitrary patterns
This PR builds on #34, adding explicit route handler for non-match patterns using the
not_found
andnot_found_async
methods.It also modifies the
worker-sandbox
Worker to narrow its match handlers to more specific HTTP methods to allow for better testing of wildcard patterns andnot_found
handler.