1
0
mirror of https://github.com/actix/examples synced 2024-11-30 17:14:35 +01:00
examples/basics/nested-routing/src/main.rs

19 lines
490 B
Rust
Raw Permalink 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<()> {
2022-12-30 17:30:16 +01:00
env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));
log::info!("starting HTTP server at http://localhost:8080");
2019-04-09 20:12:07 +02:00
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
}