-
Notifications
You must be signed in to change notification settings - Fork 110
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
Incorrect forwarding with common root at the same level #346
base: main
Are you sure you want to change the base?
Conversation
In my opinion all formatted paths should come before normal ones, which means: |
I believe there are cases where a concrete path would be desired to have precedence. Hypothetical Example:
One might want the featured products to go to a special page formatted for display, whereas the application might also support user-generated tags for products, which could show on a default display. While this could also be done within the handler logic itself (which I think would be better in most cases), there may be other complicating logic which determines the route to be the cleanest spot to separate the branches at. Just thinking out loud here, but how would that be doable with this new routing? |
It works just fine, unless I missed some cases. let apiRouter = router { let appRouter = router { let app = run app` I could not come up with an example in which request may fail. |
No you're right that looks to be the correct behavior. |
I did not get this @0-gravity. Why you make this proposition? It appears that you want to make generic paths to be evaluated before specific paths. I don't think this is a good idea. |
Incorrect forwarding with common root at the same level
for example next routing will fail
router { forward $"/roots" (text "roots") forwardf "/roots/%O" (sprintf "roots/%O" >> text) }