Skip to content
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

Add a simpler way to define route patterns #2

Open
itaym2 opened this issue Jul 5, 2017 · 1 comment
Open

Add a simpler way to define route patterns #2

itaym2 opened this issue Jul 5, 2017 · 1 comment

Comments

@itaym2
Copy link
Contributor

itaym2 commented Jul 5, 2017

Currently the library only supports regex to define route patterns:
http.get().to('/some/path/[a-zA-Z]+$').willSucceed();

I think we should support a simpler way to define such routes:
http.get().to('/some/path/{anything}').willSucceed();

Thoughts?

@YoniH
Copy link
Contributor

YoniH commented Jul 5, 2017

Good idea!
Just need to define what anything actually means. Your example regex matches only letters, anything probably implies also numbers and other characters.
Maybe anything should map to something like this: [-a-zA-Z0-9@:%_\+.~#?&\/=]*

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants