diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2020-09-24 03:44:58 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-24 03:44:58 +0000 |
commit | 4884c009d862a0692f145ec5c7dd485f2211da36 (patch) | |
tree | 0a5f92a12f3a67147700b88e51dd21f55dc00faf /src/main.rs | |
parent | Bump deps (diff) | |
parent | add test for breadcrumbs (diff) | |
download | miniserve-4884c009d862a0692f145ec5c7dd485f2211da36.tar.gz miniserve-4884c009d862a0692f145ec5c7dd485f2211da36.zip |
Merge pull request #378 from ahti/master
add title option (#335) and breadcrumb links in heading
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 7cda975..1830a70 100644 --- a/src/main.rs +++ b/src/main.rs @@ -79,6 +79,9 @@ pub struct MiniserveConfig { /// If false, creation of zip archives is disabled pub zip_enabled: bool, + + /// Shown instead of host in page title and heading + pub title: Option<String>, } fn main() { @@ -286,6 +289,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 title = conf.title.clone(); upload_route = if let Some(random_route) = conf.random_route.clone() { format!("/{}/upload", random_route) } else { @@ -315,6 +319,7 @@ fn configure_app(app: &mut web::ServiceConfig, conf: &MiniserveConfig) { u_r.clone(), tar_enabled, zip_enabled, + title.clone(), ) }) .default_handler(web::to(error_404)), |