1
0
mirror of https://github.com/actix/examples synced 2024-11-23 22:41:07 +01:00

rename to Files

This commit is contained in:
Nikolay Kim 2019-03-06 23:44:46 -08:00
parent ab2fdbd639
commit 60a9df8abd
2 changed files with 3 additions and 3 deletions

View File

@ -8,8 +8,8 @@ edition = "2018"
[dependencies]
actix-rt = "0.2"
actix-web = { git="https://github.com/actix/actix-web.git", branch = "1.0" }
actix-files = { 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" }
futures = "0.1.25"
env_logger = "0.5"

View File

@ -1,7 +1,7 @@
use std::{env, io};
use actix_files as fs;
use actix_session::{CookieSession, Session};
use actix_staticfiles as fs;
use actix_web::extract::Path;
use actix_web::http::{header, Method, StatusCode};
use actix_web::{
@ -112,7 +112,7 @@ fn main() -> io::Result<()> {
)
}))
// static files
.service(fs::StaticFiles::new("/static", "static").show_files_listing())
.service(fs::Files::new("/static", "static").show_files_listing())
// redirect
.service(web::resource("/").route(web::get().to(|req: HttpRequest| {
println!("{:?}", req);