diff options
author | Lukas Stabe <lukas@stabe.de> | 2020-09-24 03:22:45 +0000 |
---|---|---|
committer | Lukas Stabe <lukas@stabe.de> | 2020-09-24 03:22:45 +0000 |
commit | 746535b7645b6aeb6eb58dced984530744fef161 (patch) | |
tree | 58b5a8df0d9185fc707e7c57104af21b58db1aa5 /src/main.rs | |
parent | Sorry cargo fmt (diff) | |
download | miniserve-746535b7645b6aeb6eb58dced984530744fef161.tar.gz miniserve-746535b7645b6aeb6eb58dced984530744fef161.zip |
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)), |