Does reitit do the coercion before the middleware/interceptors?
@jarvinenemil it happens inside a coercion mw/int, e.g. request-coercion-middleware
@drewverlee route guards are not supported within the core router, by design. But, you can create such higher-level routers on top of the core. For ring, you would ship your own reitit.ring/ring-handler
which routes based on query-params too.
not trivial, but doable.
Hey all. Question about reitit backend routes for a SPA frontend
I have a https://gist.github.com/athomasoriginal/14c6cfa1500bc1ab1a90a98b9d7217a0. The front end is a SPA (using reitit.frontend
). My goal is to have all front end routes handled by the front end and just serve the index.html
file and not change the URL. For example
• localhost:3000/ (should serve the index.html file and not trigger a redirect)
• localhost:3000/login (should serve the index.html file and not trigger a redirect)
• localhost:3000/public/… (should serve resources as long as they exist)
Right now, based on the example code in the gist, the routing does this:
• visit localhost:3000/
is redirected to localhost:3000/index.html
• visit localhost:3000/login
results in nil
• visit localhost:3000/public/css/styles.css
will return the css file