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