Skip to content

Commit

Permalink
Update command.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
mrchantey committed Apr 4, 2024
1 parent ac3d93b commit 2d1020b
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions crates/forky/forky_cli/src/server/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@ impl Subcommand for ServerCommand {
.long("secure")
.action(ArgAction::SetTrue),
)
.arg(
Arg::new("no-fallback")
.required(false)
.help(
"if a url is not found, do not fallback to index.html",
)
.help("run with https")
.long("no-fallback")
.action(ArgAction::SetTrue),
)
.arg(
Arg::new("any-origin")
.required(false)
Expand Down Expand Up @@ -70,6 +80,7 @@ impl Subcommand for ServerCommand {
let port = args.get_one::<String>("port").ok()?;
let host = args.get_one::<String>("host").ok()?;
let secure = args.get_flag("secure");
let index_fallback = false == args.get_flag("no-fallback");
let any_origin = args.get_flag("any-origin");
let proxy = args.get_flag("proxy");
// let proxies = args
Expand All @@ -82,6 +93,7 @@ impl Subcommand for ServerCommand {
dir: dir.to_string(),
any_origin,
proxy,
index_fallback,
address: Address {
host: Address::host_from_str(&host)?,
port: port.parse::<u16>()?,
Expand Down

0 comments on commit 2d1020b

Please sign in to comment.