mirror of
https://github.com/actix/examples
synced 2025-06-28 09:50:36 +02:00
v3 examples (#364)
This commit is contained in:
@ -5,14 +5,16 @@ authors = ["Nikolay Kim <fafhrd91@gmail.com>", "dowwie <dkcdkg@gmail.com>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
actix-rt = "1.0.0"
|
||||
actix-web = "2.0.0"
|
||||
actix-session = "0.3.0"
|
||||
actix-redis = { version = "0.8.0", features = ["web"] }
|
||||
actix-web = "3"
|
||||
actix-session = "0.4"
|
||||
actix-redis = "0.9"
|
||||
env_logger = "0.7"
|
||||
serde = { version = "^1.0", features = ["derive"] }
|
||||
actix-service = "1.0.0"
|
||||
actix-http = "1.0.0"
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
actix-service = "1"
|
||||
actix-http = "2"
|
||||
rand = "0.7.3"
|
||||
serde_json = "1.0.40"
|
||||
time = "0.1.42"
|
||||
time = "0.2"
|
||||
|
||||
[dev-dependencies]
|
||||
actix-rt = "1"
|
||||
|
@ -72,7 +72,7 @@ async fn logout(session: Session) -> Result<HttpResponse> {
|
||||
}
|
||||
}
|
||||
|
||||
#[actix_rt::main]
|
||||
#[actix_web::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
std::env::set_var("RUST_LOG", "actix_web=info,actix_redis=info");
|
||||
env_logger::init();
|
||||
@ -308,7 +308,9 @@ mod test {
|
||||
.into_iter()
|
||||
.find(|c| c.name() == "test-session")
|
||||
.unwrap();
|
||||
assert!(&time::now().tm_year != &cookie_4.expires().map(|t| t.tm_year).unwrap());
|
||||
|
||||
let now = time::OffsetDateTime::now_utc();
|
||||
assert!(now.year() != cookie_4.expires().map(|t| t.year()).unwrap());
|
||||
|
||||
// Step 10: GET index, including session cookie #2 in request
|
||||
// - set-cookie actix-session will be in response (session cookie #3)
|
||||
|
Reference in New Issue
Block a user