Replies: 1 comment
-
I think creating different routes is fine. Not really clear to me why that's not RESTful but then again, REST means different things to different people 😅 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm implementing a file service and designed the API in a way to resemble REST as much as possible. Due to this, i require two routes which take a path to a directory or file.
For example, the following routes should all be valid.
A '/' at the end of the path should be a directory, without the '/' at the end, the path should be recognized as a file. The Path can contain n amount of nested directories.
This is the equivalent HTTP Method. The query parameter changes whether it is a file or directory.
I figured i could create a Route with Axum like that:
But a combiniation of these wildcards is not supported. Is there any way to achieve this 'dynamic' routing? Especially the different query parameters are important.
I am aware I could simply create different routes, e.g.
But in my opinion this is not RESTful and I would like to avoid this solution if somehow possible.
Beta Was this translation helpful? Give feedback.
All reactions