diff options
author | Eli Flanagan <eli@typedspace.com> | 2019-09-09 16:20:42 +0000 |
---|---|---|
committer | Eli Flanagan <eli@typedspace.com> | 2019-09-09 16:20:42 +0000 |
commit | a861bd22855f83163fa00f59de04b11628c9e7a5 (patch) | |
tree | 55218b5acb60fe1ebf6e862db78848535d9c6802 /src/main.rs | |
parent | wire up arguments, index.html serving still broken (diff) | |
download | miniserve-a861bd22855f83163fa00f59de04b11628c9e7a5.tar.gz miniserve-a861bd22855f83163fa00f59de04b11628c9e7a5.zip |
use actix-web method for static index
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index 46c38d1..f2dd351 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,6 @@ use simplelog::{Config, LevelFilter, TermLogger, TerminalMode}; use std::io::{self, Write}; use std::net::{IpAddr, Ipv4Addr, SocketAddr}; use std::thread; -use std::path::PathBuf; use std::time::Duration; use yansi::{Color, Paint}; @@ -239,11 +238,10 @@ fn configure_app(app: App<MiniserveConfig>) -> App<MiniserveConfig> { if path.is_file() { None } else if app.state().default_index == true { - let mut index_path = PathBuf::from(path); - index_path.push("index.html"); Some( - fs::StaticFiles::new(index_path) + fs::StaticFiles::new(path) .expect("Failed to setup static file handler") + .index_file("index.html") ) } else { let u_r = upload_route.clone(); |