diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2020-03-11 14:37:56 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-11 14:37:56 +0000 |
commit | fdf6836f7516661d01cc2c0494106ea5ebb26b60 (patch) | |
tree | ee989cd0597499c1b65b1df22da793b1eb7cfa96 /src/main.rs | |
parent | Bump reqwests to v0.10 (diff) | |
parent | Ignore clippy warning (diff) | |
download | miniserve-fdf6836f7516661d01cc2c0494106ea5ebb26b60.tar.gz miniserve-fdf6836f7516661d01cc2c0494106ea5ebb26b60.zip |
Merge pull request #235 from DamianX/archives
Added option to disable archives
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 9b9c628..2885c59 100644 --- a/src/main.rs +++ b/src/main.rs @@ -62,6 +62,9 @@ pub struct MiniserveConfig { /// Enable upload to override existing files pub overwrite_files: bool, + + /// If false, creation of archives is disabled + pub archives: bool, } fn main() { @@ -251,6 +254,7 @@ fn configure_app(app: App<MiniserveConfig>) -> App<MiniserveConfig> { let random_route = app.state().random_route.clone(); let default_color_scheme = app.state().default_color_scheme; let file_upload = app.state().file_upload; + let archives_enabled = app.state().archives; upload_route = if let Some(random_route) = app.state().random_route.clone() { format!("/{}/upload", random_route) } else { @@ -279,6 +283,7 @@ fn configure_app(app: App<MiniserveConfig>) -> App<MiniserveConfig> { random_route.clone(), default_color_scheme, u_r.clone(), + archives_enabled ) }) .default_handler(error_404), |