You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is it possible to mark a path parameter as optional? Something like route("GET", "/users/<user>/blogs/<blog>/posts/<post?>", handler("get user blog post")), where the last parameter <post> is optional.
Along the same line, it'd be great if rut supported regex match something like route("GET", "/img/<path:.*>", handler("get image")).
The regex one isn't that important but just a nice to have.
Thank you!
The text was updated successfully, but these errors were encountered:
That's how I've started doing it - having two routes. But I think having just one route is cleaner. When you have multiple optional parameters, it kind of becomes cluttered.
I understand your concern about regex matching so don't worry about it. Thank you!
Is it possible to mark a path parameter as optional? Something like
route("GET", "/users/<user>/blogs/<blog>/posts/<post?>", handler("get user blog post"))
, where the last parameter<post>
is optional.Along the same line, it'd be great if rut supported regex match something like
route("GET", "/img/<path:.*>", handler("get image"))
.The regex one isn't that important but just a nice to have.
Thank you!
The text was updated successfully, but these errors were encountered: