You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't think we need a PanicHandler baked into the router. Let me know what your rationale is if you feel it's needed but from my perspective you can always wrap the chain of handlers with a panic handler at the top - the same way you would put in a Gzip middleware or similar you can do handle a panic. And even if the panic does propagate up unhandled the HTTP server will recover and log it already by default. Seems crufty to have it built into the router when you can get the same functionality using middleware.
I'm thinking the same applies to NotFoundHandler - although I guess it could make sense to have a default if no routes match. But I think if we have it built into the router there should be a clear rationale as to why it exists and isn't just a middleware or another type of handler.
As I'm sure you're already thinking with we'll need to explore how routing works with other aspects of the URL. For example matching by domain, or http/https scheme - how does this fit into picture. Or what about matching paths regardless of method. Same thing for route groups, middleware and others. More to think about on this.
Those are my initial notes.
The text was updated successfully, but these errors were encountered:
@calvinanderson Some notes on the router stuff you did - https://github.com/gocaveman/caveman/blob/20190509-router/router/router.go; for when you get back around to this.
I don't think we need a PanicHandler baked into the router. Let me know what your rationale is if you feel it's needed but from my perspective you can always wrap the chain of handlers with a panic handler at the top - the same way you would put in a Gzip middleware or similar you can do handle a panic. And even if the panic does propagate up unhandled the HTTP server will recover and log it already by default. Seems crufty to have it built into the router when you can get the same functionality using middleware.
I'm thinking the same applies to NotFoundHandler - although I guess it could make sense to have a default if no routes match. But I think if we have it built into the router there should be a clear rationale as to why it exists and isn't just a middleware or another type of handler.
As I'm sure you're already thinking with we'll need to explore how routing works with other aspects of the URL. For example matching by domain, or http/https scheme - how does this fit into picture. Or what about matching paths regardless of method. Same thing for route groups, middleware and others. More to think about on this.
Those are my initial notes.
The text was updated successfully, but these errors were encountered: