From 6dfe4d1c9b08b108ad71945a60ba24256b61ba26 Mon Sep 17 00:00:00 2001 From: Billy Bradley Date: Sat, 1 May 2021 21:36:55 +0000 Subject: Add --spa-index option --- src/args.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/args.rs') 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, + /// 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, + /// Port to use #[clap(short = 'p', long = "port", default_value = "8080")] pub port: u16, -- cgit v1.2.3