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
Allow escaping so that a literal ":" can be used in a route. #191
Comments
|
A syntax for escaping or for use in the URL? As it stands currently, |
Yeah, just my proposed syntax. It seems reasonably unambiguous to me. |
Ok, I'll play around with the code a little bit. Just so we're clear on the expectation, declaring a route like this:
Would produce a literal url like this:
Sound right? |
Yep. |
@nathan7 I've submitted a PR with tests added to |
Use Case
I'm trying to create an OPTIONS endpoint that returns some API documentation with a url like:
/api/posts/:post/comments/:comment
No matter what I do, I can't escape the colons to prevent them from being turned into the catch-all regexps in the router.
Code
I've tracked the route string transformation all the way down to
regifyString()
in/lib/director/router.js
. It would seem that the parsing there needs to be slightly changed. If this would be a welcomed change, I can work on a PR.Thanks!
Brian Edgerton
The text was updated successfully, but these errors were encountered: