mirror of
https://github.com/actix/actix-extras.git
synced 2025-01-22 23:05:56 +01:00
update readme
This commit is contained in:
parent
af3a8d6775
commit
2a7ffe6e0a
12
README.md
12
README.md
@ -27,19 +27,19 @@ Constructor panics if key length is less than 32 bytes.
|
||||
extern crate actix_web;
|
||||
extern crate actix_redis;
|
||||
|
||||
use actix_web::*;
|
||||
use actix_web::middleware::SessionStorage;
|
||||
use actix_web::{App, server};
|
||||
use actix_web::middleware::{Logger, SessionStorage};
|
||||
use actix_redis::RedisSessionBackend;
|
||||
|
||||
fn main() {
|
||||
::std::env::set_var("RUST_LOG", "actix_web=info");
|
||||
let _ = env_logger::init();
|
||||
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(SessionStorage::new(
|
||||
RedisSessionBackend::new("127.0.0.1:6379", &[0; 32])
|
||||
|
Loading…
x
Reference in New Issue
Block a user