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

feat: SPA and `index.html` serving #420

Closed Antosser closed 8 months ago

Antosser commented 8 months ago

Copy/pasted every important bit from the previous PR.

Everything looks great except for one small problem: When the --spa flag is used, the --index flag has to be enabled as well. But the code is really split up into a lot of files and I don't know where I can set cli.index to true if cli.spa is true in the code

EstebanBorai commented 8 months ago

Copy/pasted every important bit from the previous PR.

Everything looks great except for one small problem: When the --spa flag is used, the --index flag has to be enabled as well. But the code is really split up into a lot of files and I don't know where I can set cli.index to true if cli.spa is true in the code

IIRC Clap allows you to have dependencies between arguments.

I think we can merge this and have that improvement as iteration.

Antosser commented 8 months ago

The problem from the description is still there. In the current state --spa will work weirdly without --index