anuragsoni / routes

typed bidirectional router for OCaml/ReasonML web applications
https://anuragsoni.github.io/routes/
BSD 3-Clause "New" or "Revised" License
145 stars 11 forks source link

Provide more details to the wildcard match #129

Closed anuragsoni closed 3 years ago

anuragsoni commented 3 years ago

Todo:

anuragsoni commented 3 years ago

@tsnobip @woeps Maybe this will help you define nested routes with wildcards? This needs more work but maybe this initial diff can be of help if you are exploring the routes internals.

woeps commented 3 years ago

This might be just enough of what I needed for nested routing in react apps. :partying_face: Thanks a lot!

One thing I observed: Parts.prefix and Parts.wildcard_match doesn't return the string with a leading slash, which I needed.

anuragsoni commented 3 years ago

@woeps One thing I observed: Parts.prefix and Parts.wildcard_match doesn't return the string with a leading slash, which I needed.

Good catch! There need to be some more refinements before this can be considered ready. Leading slash should indeed be present when a user gets a readable output out of a wildcard. I'll keep this in mind. Thanks!