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

Support segment contraints in dynamic routes #13

Open
testinfected opened this issue Oct 6, 2014 · 1 comment
Open

Support segment contraints in dynamic routes #13

testinfected opened this issue Oct 6, 2014 · 1 comment

Comments

@testinfected
Copy link
Owner

Make it possible to enforce a format for a dynamic segment of the route, so we can write:

get("/products/:id", where("id", "[A-Z]{2}-\d{2}")).to(...)

This route would match paths such as /products/AB-123, but not /products/123456.

Anchors will not be supported in the RegExp since we want to match the entire segment.

@testinfected
Copy link
Owner Author

RegExp matching would be the default, although other matching styles would be possible by passing a matcher rather than a string.

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

No branches or pull requests

1 participant