-
Notifications
You must be signed in to change notification settings - Fork 36
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
feat(router): add a router plugin #131
Conversation
7c0a4bf
to
8a7cfc5
Compare
I got tricked for a while, as I had forgotten that the string paths were regular expressions. This post is left for other users who may wonder why pegas is not serving matching the expected path. Any of the "magic characters"
Need to be escaped with %, for example the route "/catch-fish"
I do not consider this a bug, its likely a bug in my comprehension. |
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.
I'm relatively new with lua, so I can't speak for how it should look, however it does seem to work well.
I tested the 'routing' part of this patchset, it works well.
I got tripped up because I thought the path string was.. a string match originally,but after realising it was a regular expression, it was clear. Its possible that maybe this should be in the comments/documentation but its not a dealbreaker.
@wmealing I think that's actually a bug, we should (for simplicity sake) escape the path before matching. Such that a path Other things:
Any input appreciated. |
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.
LGTM, thanks @Tieske
This builds on top of #130
Adds a router plugin.