1
0
mirror of https://github.com/actix/examples synced 2024-12-01 01:24:35 +01:00
examples/async_ex2/src/bin/main.rs

19 lines
429 B
Rust
Raw Normal View History

2019-04-09 20:12:07 +02:00
use actix_web::{middleware, App, HttpServer};
2019-04-14 19:34:41 +02:00
use async_ex2::appconfig::config_app;
2019-04-09 20:12:07 +02:00
2019-12-07 18:59:24 +01:00
#[actix_rt::main]
async fn main() -> std::io::Result<()> {
2019-04-09 20:12:07 +02:00
std::env::set_var("RUST_LOG", "actix_server=info,actix_web=info");
env_logger::init();
2019-04-14 19:34:41 +02:00
HttpServer::new(|| {
2019-04-09 20:12:07 +02:00
App::new()
.configure(config_app)
.wrap(middleware::Logger::default())
2019-04-14 19:34:41 +02:00
})
2019-04-09 20:12:07 +02:00
.bind("127.0.0.1:8080")?
2019-12-25 17:48:33 +01:00
.run()
2019-12-07 18:59:24 +01:00
.await
2019-04-14 19:34:41 +02:00
}