2019-06-17 22:57:57 +02:00
|
|
|
// <logger>
|
|
|
|
use actix_web::middleware::Logger;
|
2020-03-02 22:53:39 +01:00
|
|
|
use env_logger::Env;
|
2019-06-17 22:57:57 +02:00
|
|
|
|
2019-12-28 18:03:17 +01:00
|
|
|
#[actix_rt::main]
|
|
|
|
async fn main() -> std::io::Result<()> {
|
2019-06-26 08:59:20 +02:00
|
|
|
use actix_web::{App, HttpServer};
|
|
|
|
|
2020-03-02 22:53:39 +01:00
|
|
|
env_logger::from_env(Env::default().default_filter_or("info")).init();
|
2019-06-17 22:57:57 +02:00
|
|
|
|
2019-06-26 08:59:20 +02:00
|
|
|
HttpServer::new(|| {
|
|
|
|
App::new()
|
|
|
|
.wrap(Logger::default())
|
|
|
|
.wrap(Logger::new("%a %{User-Agent}i"))
|
|
|
|
})
|
2019-12-28 18:03:17 +01:00
|
|
|
.bind("127.0.0.1:8088")?
|
2019-06-26 08:59:20 +02:00
|
|
|
.run()
|
2019-12-28 18:03:17 +01:00
|
|
|
.await
|
2019-06-17 22:57:57 +02:00
|
|
|
}
|
|
|
|
// </logger>
|