From ca76dff5a70e78ab0bad2134084bae480d9249bd Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 10 Apr 2018 13:21:54 -0700 Subject: [PATCH] update redis example --- examples/redis-session/Cargo.toml | 4 ++-- examples/redis-session/src/main.rs | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/redis-session/Cargo.toml b/examples/redis-session/Cargo.toml index cfa102d11..55349b41d 100644 --- a/examples/redis-session/Cargo.toml +++ b/examples/redis-session/Cargo.toml @@ -7,5 +7,5 @@ workspace = "../.." [dependencies] env_logger = "0.5" actix = "0.5" -actix-web = "0.4" -actix-redis = { version = "0.2", features = ["web"] } +actix-web = "0.5" +actix-redis = { version = "0.3", features = ["web"] } diff --git a/examples/redis-session/src/main.rs b/examples/redis-session/src/main.rs index 36df16559..f61496fc8 100644 --- a/examples/redis-session/src/main.rs +++ b/examples/redis-session/src/main.rs @@ -5,8 +5,8 @@ extern crate actix_web; extern crate actix_redis; extern crate env_logger; -use actix_web::*; -use actix_web::middleware::RequestSession; +use actix_web::{server, App, HttpRequest, HttpResponse, Result}; +use actix_web::middleware::{Logger, SessionStorage, RequestSession}; use actix_redis::RedisSessionBackend; @@ -30,12 +30,12 @@ fn main() { env_logger::init(); let sys = actix::System::new("basic-example"); - HttpServer::new( - || Application::new() + server::new( + || App::new() // enable logger - .middleware(middleware::Logger::default()) + .middleware(Logger::default()) // cookie session middleware - .middleware(middleware::SessionStorage::new( + .middleware(SessionStorage::new( RedisSessionBackend::new("127.0.0.1:6379", &[0; 32]) )) // register simple route, handle all methods