http-server-rs / http-server

Simple and configurable command-line HTTP server
https://crates.io/crates/http-server
Apache License 2.0
182 stars 20 forks source link

fix(config): `--spa` implies `--index` option #422

Closed Antosser closed 8 months ago

Antosser commented 8 months ago

If #420 there was still an issue that --spa would work very weirdly without--index; single page applications are never implemented without also usingindex.htmlfiles. This PR fixes this by automatically settingcli.indextotrueifcli.spa` is set to true.

I could throw an error if the --index flag is not passed in with --spa, but I think those are way too many keystrokes for a feature someone would already expect

I manually tested this and it works great for every case