Single page app
This PR adds an option to redirect all file misses to the path '/index.html'. This is useful for single-page apps where the routing is done client-side. I'm raising this as a draft PR because it's a new feature out of the blue, and you might not want it. :)
I'm happy to accept it.
Can you change the option description to bit though: "Single page app mode (404s are redirected to '/')". Instead of "404s redirected to '/'", "404s respond with '/index.html'". That looks to be more accurate.
It might be reasonable to just enable this whenever -x is on. It doesn't seem to collide with any other behavior.
Glad you like it! Shall we leave it as a separate option for now, then it can always be rolled into -x later? I'll wait until we've worked out the #22 so I can rebase on master.
Is there anything I can do to get this PR pulled in?
@arranf You can use my fork for now at
[dependencies.basic-http-server]
git = "https://github.com/derekdreery/basic-http-server"
branch = "single_page_app"
Any update on merging this? I'd really prefer to use this over having to depend on web-pack or the like for developing w/ yew or mogwai. Thanks!
I'll try to have a look at getting this ready to merge, but in the mean time you can either use my branch, or there is another static dev server crate that serves the index on failure, ~~but I regret I've forgotten it's name~~ microserver.