mirror of
https://github.com/actix/examples
synced 2025-02-17 07:23:29 +01:00
enable files listing
This commit is contained in:
parent
71e83fb87c
commit
40b5498902
@ -7,10 +7,15 @@ edition = "2018"
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-rt = "0.1"
|
actix-rt = "0.1"
|
||||||
|
|
||||||
actix-web = { git="https://github.com/actix/actix-web.git", branch = "1.0" }
|
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-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-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"
|
futures = "0.1.25"
|
||||||
env_logger = "0.5"
|
env_logger = "0.5"
|
||||||
bytes = "0.4"
|
bytes = "0.4"
|
||||||
|
@ -112,7 +112,7 @@ fn main() -> io::Result<()> {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
// static files
|
// static files
|
||||||
.service(fs::StaticFiles::new("/static", "static").unwrap())
|
.service(fs::StaticFiles::new("/static", "static").show_files_listing())
|
||||||
// redirect
|
// redirect
|
||||||
.resource("/", |r| {
|
.resource("/", |r| {
|
||||||
r.route(web::get().to(|req: HttpRequest| {
|
r.route(web::get().to(|req: HttpRequest| {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user