How does the path based routing work, for example, with Tea Sampler?
How come can I put https://frequal.com/tea-sampler/buttons in the URL bar and it will load the Buttons page? When in the network debugger it shows a 404 for /buttons.
I'm trying Flavour out in a local demo application, and I just get the 404 not found response when trying to navigate directly to one of my routes by entering the path directly. Navigating by a button event and Routing.open() works fine.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I assume that the teasampler uses an HTTP server, that serves the index.html from the root of the deployment when a subpath is requested, that does not exist physically. That is doable with Apache, but also using a servlet (the latter requiring you to implement it).
The HTML code is served as the body of the 404 response. Why no 200 is used is beyond me.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
How does the path based routing work, for example, with Tea Sampler?
How come can I put https://frequal.com/tea-sampler/buttons in the URL bar and it will load the Buttons page? When in the network debugger it shows a 404 for /buttons.
I'm trying Flavour out in a local demo application, and I just get the 404 not found response when trying to navigate directly to one of my routes by entering the path directly. Navigating by a button event and Routing.open() works fine.
I assume that the teasampler uses an HTTP server, that serves the index.html from the root of the deployment when a subpath is requested, that does not exist physically. That is doable with Apache, but also using a servlet (the latter requiring you to implement it).
The HTML code is served as the body of the 404 response. Why no 200 is used is beyond me.
The web app must redirect 404 to the application home page, allowing routing to work for alternate paths.
Add this in your web.xml:
This should be in the Flavour archetype, I'll make a ticket to add it there to save a step. Thanks for pointing this out.
I've added this info to the Flavour book, section 7.3.2:
https://frequal.com/Flavour/book.html