mirror of
https://github.com/actix/examples
synced 2024-12-01 01:24:35 +01:00
19 lines
433 B
Rust
19 lines
433 B
Rust
use actix_web::{middleware, App, HttpServer};
|
|
|
|
use async_ex2::appconfig::config_app;
|
|
|
|
#[actix_web::main]
|
|
async fn main() -> std::io::Result<()> {
|
|
std::env::set_var("RUST_LOG", "actix_server=info,actix_web=info");
|
|
env_logger::init();
|
|
|
|
HttpServer::new(|| {
|
|
App::new()
|
|
.configure(config_app)
|
|
.wrap(middleware::Logger::default())
|
|
})
|
|
.bind(("127.0.0.1", 8080))?
|
|
.run()
|
|
.await
|
|
}
|