elm-server icon indicating copy to clipboard operation
elm-server copied to clipboard

Feature request: Option to rewrite paths to serve start-path

Open rundis opened this issue 8 years ago • 0 comments

Firstly tx for a very handy npm lib.

Had a hard time coming up with a short description, so here's a bit of context:

  • I have a single page app using elm-transit-router
  • When navigating between pages it changes the browser-url according to how I set up routing

So a typical scenario in my sample app (https://github.com/rundis/albums):

  • elm-server Main.elm --output main.js --start-path index.html
  • I get an url like: http://localhost:3001
  • I navigate to an artist listing page and get a browser-url: http://localhost:3001/artists
  • I make a change in some elm file
  • elm-server recompiles as expected, but my browser does a get request to http://localhost:3001/artists which I suppose is fair play, but unfortunately that obviously results in a 404.

That sort of ruins the flow quite a bit. So it would be super awesome if there was some solution to handle this scenario. Maybe a glob-pattern to tell the server to serve (say index.html) for any url in the glob pattern ?

rundis avatar Feb 26 '16 16:02 rundis