-
Notifications
You must be signed in to change notification settings - Fork 11
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
Matching wildcard #20
Comments
You can achieve the behavior you've described using a parameter that matches anything as follows: routes: {
r'/:id(\d+)': ... // people details
r'/': ... // people screen
r':_(.*)': ... // redirect
} Have I misunderstood; does this fail to meet your criteria in any way? Is this simply about the ergonomics of it? |
does this EDIT: if |
I found whats not ok :) I can't do: |
Thank you for the example! I think this is another possible use case for #19, which would allow you to define it as |
Ok ill try that :) |
Hello
I have seen the issue before #18 and read your comment about it
Now we do have a use case for it and I am working on a library that needs it :)
I am working on a routing library that would let you use it with ease and now with web support the library really needs a wildcard matching for routing
under /people route:
No i would like users to be able to redirect to other paths with ease and currently it is not possible
as you can see from the example above I would like to redirect users from anything that doesn't match "/" or "/:id(\d+)" back to "/people"
but not because i cant match a wildcard so I can't implement such a capability
I can't use
prefix: true
as a user might not want it in other routes..that just an easy example and the sky is the limit of course
I propose to add
wildcard: bool
option that set tofalse
by default so then users can choose if to add support for wildcard matching or notif you are referring to
toPath
method you can throw an error or return null as its not something anyone should use... (maybe just generate a random path haha)otherwise I dont see any other issues with that
I just put on a good example :)
Ill be happy if you can consider the option to put it back in some form as I think it would be very beneficial for web libraries
The text was updated successfully, but these errors were encountered: