1
0
mirror of https://github.com/actix/examples synced 2024-11-27 16:02:57 +01:00

enable files listing

This commit is contained in:
Nikolay Kim 2019-03-06 09:27:56 -08:00
parent 71e83fb87c
commit 40b5498902
2 changed files with 6 additions and 1 deletions

View File

@ -7,10 +7,15 @@ edition = "2018"
[dependencies]
actix-rt = "0.1"
actix-web = { git="https://github.com/actix/actix-web.git", branch = "1.0" }
actix-session = { git="https://github.com/actix/actix-web.git", branch = "1.0" }
actix-staticfiles = { git="https://github.com/actix/actix-web.git", branch = "1.0" }
#actix-web = { path="../../actix-web/" }
#actix-session = { path="../../actix-web/actix-session/" }
#actix-staticfiles = { path="../../actix-web/actix-staticfiles/" }
futures = "0.1.25"
env_logger = "0.5"
bytes = "0.4"

View File

@ -112,7 +112,7 @@ fn main() -> io::Result<()> {
})
})
// static files
.service(fs::StaticFiles::new("/static", "static").unwrap())
.service(fs::StaticFiles::new("/static", "static").show_files_listing())
// redirect
.resource("/", |r| {
r.route(web::get().to(|req: HttpRequest| {