-
Notifications
You must be signed in to change notification settings - Fork 72
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
NotFound Handler #20
Comments
Since routing is now performed before the middleware stack, you can now do this yourself! Just take a peek at the matched |
Cool. thanks! |
This does not work well when you have SubMix. For example: rootMux := goji.NewMux()
v1Mux :=goji.SubMux()
rootMux.HandleC(pat.New("/v1/*"), v1Mux)
v1Mux.HandleC(pat.Get("/foo"), FooHandler) Then there seems no way to return a customized 404 for Any ideas? |
looks like the hacky way around the problem is to apply the 404 middleware to your sub muxes as well
Like you mentioned, while Line 14 in 9798f39
Line 52 in 9798f39
Let me know if you found a better way to tackle this? @zenazn thoughts? |
You can write an abstraction to create new Trying to auto-detect
|
For prior art on a |
@zenazn I understand your concerns, however, it feels to me that such a basic need should be directly supported by the framework, instead of asking everyone to duplicate the work. |
Even if Goji provided some kind of |
The "notFound Handler" was a neat convenience in zenazn/goji
https://github.com/goji/goji/blob/master/router_trie.go doesn't seem to have a similar concept - probably because you decided to make less assumptions in goji2
I'm wondering what would be the best way to implement a custom 404 handler with goji2
thanks for new libs
The text was updated successfully, but these errors were encountered: