mirror of
https://github.com/actix/actix-web.git
synced 2024-11-26 11:31:09 +00:00
update redis example
This commit is contained in:
parent
88f66d49d0
commit
ca76dff5a7
2 changed files with 8 additions and 8 deletions
|
@ -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"] }
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue