-
-
Notifications
You must be signed in to change notification settings - Fork 117
Added example of 404/405 handling as discussed in #62 #63
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
Conversation
|
If I understand this example, I would need to use |
|
Yes, that is correct. I would say you might want to write a little helper to wrap it up: var route = router.route('/foo')
// add methods...
handle405(route) |
|
Yep, that's what I'd do. Let me give it a shot. |
|
Anyone have input on adding examples like this? @whitlockjc said that the approach worked for his use case. If no one opposed it would be nice to get this merged. |
|
I wish there was a better way to do this, like a single |
500ff08 to
a8c447e
Compare
a8c447e to
7c2ee89
Compare
dougwilson
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I made some modifications, mainly just some rewording and fixing the example to not use Express-only syntax like res.status() which wouldn't work if the example was actually ran.
Good call, I will remember this for the future. |
If this in fact works then it is a nice addition since it is a bit more complex than the existing examples in the readme. @whitlockjc Can you update if the solution actually solves your problem?