From b3f170e7edf77e6a37f11af8701d427a9b2fe204 Mon Sep 17 00:00:00 2001 From: Eli Flanagan Date: Thu, 12 Sep 2019 19:57:21 -0400 Subject: change to path option for configurability --- src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index f2dd351..5db9b31 100644 --- a/src/main.rs +++ b/src/main.rs @@ -52,8 +52,8 @@ pub struct MiniserveConfig { /// Default color scheme pub default_color_scheme: themes::ColorScheme, - /// Serve index.* files by default - pub default_index: bool, + /// name of an index files to serve by default + pub index: Option, /// Enable file upload pub file_upload: bool, @@ -237,11 +237,11 @@ fn configure_app(app: App) -> App { }; if path.is_file() { None - } else if app.state().default_index == true { + } else if let Some(index_file) = &app.state().index { Some( fs::StaticFiles::new(path) .expect("Failed to setup static file handler") - .index_file("index.html") + .index_file(index_file.to_string_lossy()) ) } else { let u_r = upload_route.clone(); -- cgit v1.2.3