alexmingoia / purescript-pux

Build type-safe web apps with PureScript.
https://www.purescript-pux.org
Other
566 stars 76 forks source link

Page refresh on a route results in 404 page not found #140

Closed kingsleyh closed 7 years ago

kingsleyh commented 7 years ago

Hi

I cloned the todo mvc app here: https://github.com/alexmingoia/pux-todomvc and got it running - when I add some TODO's and complete them and then click on the list of completed - everything works as expected.

But if I just refresh the page or navigate directly to http://localhost:5000/completed - I get a 404 Page not found.

I came across this in an app I was trying to build at the purescript meetup and cloned the ToDo app to verify if it was me or a problem. It looks like it's a problem with Pux.

kingsleyh commented 7 years ago

Hi

turns out that this was due to the npm serve in the package.json for the project.

  "serve": "npm run build && serve -s static",

adding a -s (for single) fixes the issue as shown above