refactor + more async

This commit is contained in:
MeexReay 2024-08-23 22:35:41 +03:00
parent 9cf1a41b52
commit 2c87b173e3
7 changed files with 399 additions and 94 deletions

View file

@ -63,7 +63,8 @@ impl HttpServer for EzSite {
}
}
fn main() {
#[tokio::main]
async fn main() {
let site = EzSite::new("<h1>Hello World!</h1>");
let host = "localhost:8080";
@ -71,5 +72,6 @@ fn main() {
.timeout(Some(Duration::from_secs(5)))
.threads(5)
.start_forever()
.await
.expect("http server error");
}