[Vuejs]-Middleman with vue-router loading 'Page Not Found' on page reload

0👍

Configure your backend to return index.html when the requested address is chapter/:id, or, whenever it’s not an address in your backend api list.

When we use a single-page-app built with vue, we are always in index.html, which has a app.js or something running all along, and when the route changes, the script detects that and change the page content, but we never left index.html. So when we reload the page, the browser requests a document/html from the server, when the html arrives with the js script inside it, the script runs, determines what to show due to the address/route, and we are up and going fine.

So in your case, just need to fix the “make sure the browser gets the html file when visiting /chapter/:id” part.

Leave a comment