mirror of
https://github.com/fafhrd91/actix-web
synced 2025-01-18 05:41:50 +01:00
update guide examples
This commit is contained in:
parent
ff14633b3d
commit
48e7013997
@ -105,9 +105,7 @@ fn main() {
|
|||||||
.middleware(middleware::Logger::default())
|
.middleware(middleware::Logger::default())
|
||||||
// cookie session middleware
|
// cookie session middleware
|
||||||
.middleware(middleware::SessionStorage::new(
|
.middleware(middleware::SessionStorage::new(
|
||||||
middleware::CookieSessionBackend::build(&[0; 32])
|
middleware::CookieSessionBackend::new(&[0; 32]).secure(false)
|
||||||
.secure(false)
|
|
||||||
.finish()
|
|
||||||
))
|
))
|
||||||
// register favicon
|
// register favicon
|
||||||
.resource("/favicon.ico", |r| r.f(favicon))
|
.resource("/favicon.ico", |r| r.f(favicon))
|
||||||
|
@ -203,9 +203,8 @@ fn main() {
|
|||||||
server::new(
|
server::new(
|
||||||
|| App::new()
|
|| App::new()
|
||||||
.middleware(SessionStorage::new( // <- create session middleware
|
.middleware(SessionStorage::new( // <- create session middleware
|
||||||
CookieSessionBackend::build(&[0; 32]) // <- create cookie session backend
|
CookieSessionBackend::new(&[0; 32]) // <- create cookie session backend
|
||||||
.secure(false)
|
.secure(false)
|
||||||
.finish()
|
|
||||||
)))
|
)))
|
||||||
.bind("127.0.0.1:59880").unwrap()
|
.bind("127.0.0.1:59880").unwrap()
|
||||||
.start();
|
.start();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user