Skip to content

Commit

Permalink
update redis example
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Apr 10, 2018
1 parent 88f66d4 commit ca76dff
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions examples/redis-session/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
12 changes: 6 additions & 6 deletions examples/redis-session/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;


Expand All @@ -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
Expand Down

0 comments on commit ca76dff

Please sign in to comment.