mirror of
https://github.com/fafhrd91/actix-web
synced 2025-01-18 22:01:50 +01:00
parent
2803fcbe22
commit
f5fd6bc49f
@ -7,7 +7,8 @@ use futures::StreamExt;
|
|||||||
use http::header::HeaderValue;
|
use http::header::HeaderValue;
|
||||||
use log::info;
|
use log::info;
|
||||||
|
|
||||||
fn main() -> io::Result<()> {
|
#[actix_rt::main]
|
||||||
|
async fn main() -> io::Result<()> {
|
||||||
env::set_var("RUST_LOG", "echo=info");
|
env::set_var("RUST_LOG", "echo=info");
|
||||||
env_logger::init();
|
env_logger::init();
|
||||||
|
|
||||||
@ -37,4 +38,5 @@ fn main() -> io::Result<()> {
|
|||||||
.tcp()
|
.tcp()
|
||||||
})?
|
})?
|
||||||
.run()
|
.run()
|
||||||
|
.await
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,8 @@ async fn handle_request(mut req: Request) -> Result<Response, Error> {
|
|||||||
.body(body))
|
.body(body))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> io::Result<()> {
|
#[actix_rt::main]
|
||||||
|
async fn main() -> io::Result<()> {
|
||||||
env::set_var("RUST_LOG", "echo=info");
|
env::set_var("RUST_LOG", "echo=info");
|
||||||
env_logger::init();
|
env_logger::init();
|
||||||
|
|
||||||
@ -28,4 +29,5 @@ fn main() -> io::Result<()> {
|
|||||||
HttpService::build().finish(handle_request).tcp()
|
HttpService::build().finish(handle_request).tcp()
|
||||||
})?
|
})?
|
||||||
.run()
|
.run()
|
||||||
|
.await
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,8 @@ use futures::future;
|
|||||||
use http::header::HeaderValue;
|
use http::header::HeaderValue;
|
||||||
use log::info;
|
use log::info;
|
||||||
|
|
||||||
fn main() -> io::Result<()> {
|
#[actix_rt::main]
|
||||||
|
async fn main() -> io::Result<()> {
|
||||||
env::set_var("RUST_LOG", "hello_world=info");
|
env::set_var("RUST_LOG", "hello_world=info");
|
||||||
env_logger::init();
|
env_logger::init();
|
||||||
|
|
||||||
@ -24,4 +25,5 @@ fn main() -> io::Result<()> {
|
|||||||
.tcp()
|
.tcp()
|
||||||
})?
|
})?
|
||||||
.run()
|
.run()
|
||||||
|
.await
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user