1
0
mirror of https://github.com/actix/actix-website synced 2024-11-24 00:41:07 +01:00
actix-website/docs/http_server_init.md

23 lines
444 B
Markdown
Raw Normal View History

---
2020-09-12 17:21:54 +02:00
title: HTTP Server Initialization
---
# Architecture overview
2020-09-12 17:21:54 +02:00
Below is a diagram of HttpServer initialization, which happens on the following code
```rust
2020-09-12 17:21:54 +02:00
#[actix_web::main]
async fn main() -> std::io::Result<()> {
HttpServer::new(|| {
App::new()
.route("/", web::to(|| HttpResponse::Ok()))
})
2022-02-26 04:56:24 +01:00
.bind(("127.0.0.1", 8080))?
.run()
.await
}
```
![HTTP Server Diagram](/img/diagrams/http_server.svg)