diff --git a/Cargo.toml b/Cargo.toml index 98b2369..8794886 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ actix-web = "0.7" bytes = "0.4" clap = "2" env_logger = "*" +log = "*" futures = "0.1" tar = "0.4" percent-encoding = "1.0" diff --git a/src/main.rs b/src/main.rs index 8cb5045..b2dd0c0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,6 +7,7 @@ extern crate htmlescape; extern crate percent_encoding; #[macro_use] extern crate clap; +#[macro_use] extern crate log; mod channel; mod web; @@ -45,17 +46,19 @@ fn main() -> Result<(), io::Error> { let addr = matches.value_of("addr").unwrap(); let bind_addr = format!("{}:{}", addr, port); - std::env::set_var("RUST_LOG", "actix_web=info"); + std::env::set_var("RUST_LOG", "info"); env_logger::init(); let sys = actix::System::new("http_server_rs"); - let chdir = String::from(chdir); - server::new(move || web::create_app(&chdir)) + let directory = String::from(chdir); + server::new(move || web::create_app(&directory)) .bind(&bind_addr) .expect(&format!("Can't listen on {} ", bind_addr)) .start(); + info!("Serving files from {}", chdir); + let _ = sys.run(); Ok(()) }