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
Right now, a lot of frontend applications use HTML5 history mode for in-app navigation. This results in URL being replaced in browser history (ex. / => hello) without actually making a request to the new URL. This allows for frontend applications to replace their content dynamically, and use frontend only routing.
The issue is, if user reloads the page or just visits the URL by hand, there seems no way to handle that in Klein - at least I found nothing like that in source or docs - correct me if I am wrong here. As a result, user gets 404d.
If there is no such option, could we add one? If so, it should be possible to:
Have all post-routing 404's redirected to any one configurable path
Request with the new path should re-enter the router and match as usual
Is there an option to set up a "default" route?
Right now, a lot of frontend applications use HTML5 history mode for in-app navigation. This results in URL being replaced in browser history (ex.
/ => hello
) without actually making a request to the new URL. This allows for frontend applications to replace their content dynamically, and use frontend only routing.The issue is, if user reloads the page or just visits the URL by hand, there seems no way to handle that in Klein - at least I found nothing like that in source or docs - correct me if I am wrong here. As a result, user gets 404d.
If there is no such option, could we add one? If so, it should be possible to:
Kind of like
REQUEST /hello/world => 404? => rewrite path to / => REQUEST /
Less having hardcoded paths, not sure if there is a better way.
The text was updated successfully, but these errors were encountered: