diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2021-01-05 06:08:53 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-05 06:08:53 +0000 |
commit | 39082dff86c1b304161cad782e2a0d5cd38592e2 (patch) | |
tree | c53882d24eae9e6a179d888ce6d5a9068e4d54a3 /src/main.rs | |
parent | Fix lint (diff) | |
parent | Fix indentation (diff) | |
download | miniserve-39082dff86c1b304161cad782e2a0d5cd38592e2.tar.gz miniserve-39082dff86c1b304161cad782e2a0d5cd38592e2.zip |
Merge pull request #423 from levaitamas/dirs-first
Add option to list directories first
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 04a9cae..136b986 100644 --- a/src/main.rs +++ b/src/main.rs @@ -83,6 +83,9 @@ pub struct MiniserveConfig { /// If false, creation of zip archives is disabled pub zip_enabled: bool, + /// If enabled, directories are listed first + pub dirs_first: bool, + /// Shown instead of host in page title and heading pub title: Option<String>, } @@ -295,6 +298,7 @@ fn configure_app(app: &mut web::ServiceConfig, conf: &MiniserveConfig) { let file_upload = conf.file_upload; let tar_enabled = conf.tar_enabled; let zip_enabled = conf.zip_enabled; + let dirs_first = conf.dirs_first; let title = conf.title.clone(); upload_route = if let Some(random_route) = conf.random_route.clone() { format!("/{}/upload", random_route) @@ -327,6 +331,7 @@ fn configure_app(app: &mut web::ServiceConfig, conf: &MiniserveConfig) { u_r.clone(), tar_enabled, zip_enabled, + dirs_first, title.clone(), ) }) |