mirror of
https://github.com/actix/examples
synced 2024-11-23 22:41:07 +01:00
rename to Files
This commit is contained in:
parent
ab2fdbd639
commit
60a9df8abd
@ -8,8 +8,8 @@ edition = "2018"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
actix-rt = "0.2"
|
actix-rt = "0.2"
|
||||||
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-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-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"
|
futures = "0.1.25"
|
||||||
env_logger = "0.5"
|
env_logger = "0.5"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
use std::{env, io};
|
use std::{env, io};
|
||||||
|
|
||||||
|
use actix_files as fs;
|
||||||
use actix_session::{CookieSession, Session};
|
use actix_session::{CookieSession, Session};
|
||||||
use actix_staticfiles as fs;
|
|
||||||
use actix_web::extract::Path;
|
use actix_web::extract::Path;
|
||||||
use actix_web::http::{header, Method, StatusCode};
|
use actix_web::http::{header, Method, StatusCode};
|
||||||
use actix_web::{
|
use actix_web::{
|
||||||
@ -112,7 +112,7 @@ fn main() -> io::Result<()> {
|
|||||||
)
|
)
|
||||||
}))
|
}))
|
||||||
// static files
|
// static files
|
||||||
.service(fs::StaticFiles::new("/static", "static").show_files_listing())
|
.service(fs::Files::new("/static", "static").show_files_listing())
|
||||||
// redirect
|
// redirect
|
||||||
.service(web::resource("/").route(web::get().to(|req: HttpRequest| {
|
.service(web::resource("/").route(web::get().to(|req: HttpRequest| {
|
||||||
println!("{:?}", req);
|
println!("{:?}", req);
|
||||||
|
Loading…
Reference in New Issue
Block a user