mirror of
https://github.com/actix/examples
synced 2024-11-23 22:41:07 +01:00
changed order of logging middleware, which must register last
This commit is contained in:
parent
6c7b068a90
commit
4e3a42d77d
@ -82,10 +82,10 @@ fn main() -> io::Result<()> {
|
||||
|
||||
HttpServer::new(|| {
|
||||
App::new()
|
||||
// enable logger
|
||||
.wrap(middleware::Logger::default())
|
||||
// cookie session middleware
|
||||
.wrap(CookieSession::signed(&[0; 32]).secure(false))
|
||||
// enable logger
|
||||
.wrap(middleware::Logger::default())
|
||||
// register favicon
|
||||
.service(favicon)
|
||||
// register simple route, handle all methods
|
||||
|
@ -22,12 +22,12 @@ fn main() -> std::io::Result<()> {
|
||||
|
||||
HttpServer::new(|| {
|
||||
App::new()
|
||||
.wrap(middleware::Logger::default())
|
||||
.wrap(IdentityService::new(
|
||||
CookieIdentityPolicy::new(&[0; 32])
|
||||
.name("auth-example")
|
||||
.secure(false),
|
||||
))
|
||||
.wrap(middleware::Logger::default())
|
||||
.service(web::resource("/login").route(web::post().to(login)))
|
||||
.service(web::resource("/logout").to(logout))
|
||||
.service(web::resource("/").route(web::get().to(index)))
|
||||
|
@ -26,10 +26,10 @@ fn main() -> std::io::Result<()> {
|
||||
|
||||
HttpServer::new(|| {
|
||||
App::new()
|
||||
// enable logger
|
||||
.wrap(middleware::Logger::default())
|
||||
// redis session middleware
|
||||
.wrap(RedisSession::new("127.0.0.1:6379", &[0; 32]))
|
||||
// enable logger
|
||||
.wrap(middleware::Logger::default())
|
||||
// register simple route, handle all methods
|
||||
.service(web::resource("/").to(index))
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user