mirror of
https://github.com/actix/examples
synced 2025-06-26 17:17:42 +02:00
enable logger
This commit is contained in:
@ -11,10 +11,6 @@ actix-web = { git="https://github.com/actix/actix-web.git", branch = "1.0" }
|
||||
actix-session = { git="https://github.com/actix/actix-web.git", branch = "1.0" }
|
||||
actix-staticfiles = { git="https://github.com/actix/actix-web.git", branch = "1.0" }
|
||||
|
||||
#actix-web = { path="../../actix-web/" }
|
||||
#actix-session = { path="../../actix-web/actix-session/" }
|
||||
#actix-staticfiles = { path="../../actix-web/actix-staticfiles/" }
|
||||
|
||||
futures = "0.1.25"
|
||||
env_logger = "0.5"
|
||||
bytes = "0.4"
|
||||
|
@ -5,7 +5,8 @@ use actix_staticfiles as fs;
|
||||
use actix_web::extract::Path;
|
||||
use actix_web::http::{header, Method, StatusCode};
|
||||
use actix_web::{
|
||||
error, guard, web, App, Error, HttpRequest, HttpResponse, HttpServer, Result,
|
||||
error, guard, middleware, web, App, Error, HttpRequest, HttpResponse, HttpServer,
|
||||
Result,
|
||||
};
|
||||
use bytes::Bytes;
|
||||
use futures::unsync::mpsc;
|
||||
@ -79,7 +80,7 @@ fn main() -> io::Result<()> {
|
||||
HttpServer::new(|| {
|
||||
App::new()
|
||||
// enable logger
|
||||
// .middleware(middleware::Logger::default())
|
||||
.middleware(middleware::Logger::default())
|
||||
// cookie session middleware
|
||||
.middleware(CookieSession::signed(&[0; 32]).secure(false))
|
||||
// register favicon
|
||||
|
Reference in New Issue
Block a user