diff options
author | Damian <damian@autistici.org> | 2019-12-17 20:00:04 +0000 |
---|---|---|
committer | Damian <damian@autistici.org> | 2020-03-02 06:07:20 +0000 |
commit | d0be1f2ea97342ef577ebe879971776422b08038 (patch) | |
tree | 8af7ecae6095619957e719b763407b9bd8bd3501 /src/main.rs | |
parent | Merge pull request #254 from svenstaro/dependabot/cargo/rstest-0.5.3 (diff) | |
download | miniserve-d0be1f2ea97342ef577ebe879971776422b08038.tar.gz miniserve-d0be1f2ea97342ef577ebe879971776422b08038.zip |
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), |