diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2021-10-25 23:56:22 +0000 |
---|---|---|
committer | Sven-Hendrik Haase <svenstaro@gmail.com> | 2021-10-25 23:56:22 +0000 |
commit | 443c19783693e8900c286d3f1841ee57001e5937 (patch) | |
tree | b51da9d1c7c8857e87c06c305d2f680fa6c77af1 /src/args.rs | |
parent | Fix lint (diff) | |
download | miniserve-443c19783693e8900c286d3f1841ee57001e5937.tar.gz miniserve-443c19783693e8900c286d3f1841ee57001e5937.zip |
Refactor SPA-mode to make it more ergonomic
Diffstat (limited to 'src/args.rs')
-rw-r--r-- | src/args.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/args.rs b/src/args.rs index 6f7b1b1..a5a61d1 100644 --- a/src/args.rs +++ b/src/args.rs @@ -26,13 +26,13 @@ pub struct CliArgs { #[clap(long, parse(from_os_str), name = "index_file", value_hint = ValueHint::FilePath)] pub index: Option<PathBuf>, - /// The index file of a single page application + /// Activate SPA (Single Page Application) mode /// - /// If this option is set, miniserve will serve the specified file instead of a 404 page when - /// a non-existent path is requested. This is intended for single-page applications where - /// routing takes place on the client side. - #[clap(long, parse(from_os_str), name = "spa_index_file", value_hint = ValueHint::FilePath)] - pub spa_index: Option<PathBuf>, + /// This will cause the file given by --index to be served for all non-existing file paths. In + /// effect, this will serve the index file whenever a 404 would otherwise occur in order to + /// allow the SPA router to handle the request instead. + #[clap(long, requires = "index_file")] + pub spa: bool, /// Port to use #[clap(short = 'p', long = "port", default_value = "8080")] |