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

18 lines
438 B
Rust
Raw Normal View History

2019-04-09 20:12:07 +02:00
use actix_web::{middleware, App, HttpServer};
2022-02-18 03:02:44 +01:00
use nested_routing::app_config::config_app;
2019-04-09 20:12:07 +02:00
2020-09-12 17:49:45 +02:00
#[actix_web::main]
2019-12-07 18:59:24 +01:00
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
})
2022-02-17 21:22:36 +01: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
}