aboutsummaryrefslogtreecommitdiffstats
path: root/src/args.rs
diff options
context:
space:
mode:
authorBilly Bradley <billy@yooguru.com>2021-05-01 21:36:55 +0000
committerBilly Bradley <billy@squeno.com>2021-10-08 15:53:51 +0000
commit6dfe4d1c9b08b108ad71945a60ba24256b61ba26 (patch)
tree01bfd787c85ae17331e00b24d5bdc13d65a823a8 /src/args.rs
parentMerge pull request #613 from svenstaro/dependabot/cargo/assert_fs-1.0.6 (diff)
downloadminiserve-6dfe4d1c9b08b108ad71945a60ba24256b61ba26.tar.gz
miniserve-6dfe4d1c9b08b108ad71945a60ba24256b61ba26.zip
Add --spa-index option
Diffstat (limited to 'src/args.rs')
-rw-r--r--src/args.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/args.rs b/src/args.rs
index c610bbe..5595bea 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -32,6 +32,14 @@ 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
+ ///
+ /// 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>,
+
/// Port to use
#[clap(short = 'p', long = "port", default_value = "8080")]
pub port: u16,