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

Add prependRoute method #13

Open
thorewi opened this issue Jan 15, 2022 · 1 comment
Open

Add prependRoute method #13

thorewi opened this issue Jan 15, 2022 · 1 comment

Comments

@thorewi
Copy link

thorewi commented Jan 15, 2022

Hi,

in ErrorPresenter I create catchall route looking like this [<url .*>] to get {link this} or {link 404!} working in the error template. But I need to prepend it to avoid the request being consumed by another route (looking like this <presenter>/<action>[/<id>] for example). I need to avoid using Route constructor that's why I can't use prepend method which needs it (every RouteList can use different Route class). I need to create the route in a way addRoute method is doing this. If you think it is a good idea, I can create PR. Thank you.

@mabar
Copy link

mabar commented Nov 27, 2022

Not sure, if you chose the right way to solve that problem. How would be a prepend different from defining the route first in the list? Also if the route catches everything then routes after that one would never match.
To make route generating work for an error presenter just create e.g. /error route.
I don't think you even need error codes, because you don't want user to be able to control codes and for general error it is okay to just have 404 code

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

No branches or pull requests

2 participants