From d0be1f2ea97342ef577ebe879971776422b08038 Mon Sep 17 00:00:00 2001 From: Damian Date: Tue, 17 Dec 2019 21:00:04 +0100 Subject: Added option to disable archives --- src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/main.rs') 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) -> App { 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) -> App { random_route.clone(), default_color_scheme, u_r.clone(), + archives_enabled ) }) .default_handler(error_404), -- cgit v1.2.3