When Accessing Front-end SPA-links From Browser, Back-end Fires Finding No Route
I have a working front-end single-page-application written in JS (ReactJS), and a working back-end in Phoenix (Elixir). Everything works out fine as long as navigation happens with
Solution 1:
The standard way to do this for Single-Page Applications is to serve the exact same thing on every GET route as you're serving on /
. You can add a wildcard GET route to your Phoenix Router and point it to the same thing as the route for /
. If /
is served from PageController
's index
function, you should add:
get "/*anything", PageController, :index
Post a Comment for "When Accessing Front-end SPA-links From Browser, Back-end Fires Finding No Route"