mirror of
https://github.com/actix/examples
synced 2024-11-23 22:41:07 +01:00
enable files listing
This commit is contained in:
parent
71e83fb87c
commit
40b5498902
@ -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"
|
||||
|
@ -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| {
|
||||
|
Loading…
Reference in New Issue
Block a user