From a861bd22855f83163fa00f59de04b11628c9e7a5 Mon Sep 17 00:00:00 2001 From: Eli Flanagan Date: Mon, 9 Sep 2019 12:20:42 -0400 Subject: use actix-web method for static index --- src/main.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src') 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) -> App { 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(); -- cgit v1.2.3