mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-22 02:03:08 +02:00
add request logging
This commit is contained in:
parent
812b49587f
commit
e555af8895
1 changed files with 9 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
|||
#![deny(clippy::all)]
|
||||
|
||||
use crate::storage::{KVStorage, Storage};
|
||||
use actix_web::{get, web, App, HttpServer, Responder, Scope};
|
||||
use actix_web::{get, middleware::Logger, web, App, HttpServer, Responder, Scope};
|
||||
use api::{api_scope, ServerState};
|
||||
use clap::Arg;
|
||||
use failure::Fallible;
|
||||
|
@ -61,10 +61,14 @@ async fn main() -> Fallible<()> {
|
|||
let server_state = ServerState::new(server_box);
|
||||
|
||||
log::warn!("Serving on port {}", port);
|
||||
HttpServer::new(move || App::new().service(app_scope(server_state.clone())))
|
||||
.bind(format!("0.0.0.0:{}", port))?
|
||||
.run()
|
||||
.await?;
|
||||
HttpServer::new(move || {
|
||||
App::new()
|
||||
.wrap(Logger::default())
|
||||
.service(app_scope(server_state.clone()))
|
||||
})
|
||||
.bind(format!("0.0.0.0:{}", port))?
|
||||
.run()
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue