From 3e00d296f83c49bf4f2c07fa3d527aac694b37d7 Mon Sep 17 00:00:00 2001 From: videogame hacker Date: Mon, 25 Oct 2021 00:31:24 +0100 Subject: [PATCH] Use the IP env var instead of HOST since HOST is used for the hostname lmao --- README.md | 2 +- src/main.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 655a69b..a138caa 100644 --- a/README.md +++ b/README.md @@ -7,5 +7,5 @@ A Rust HTTP service that allows you to watch videos together with friends. ```shell $ cargo run --release # The server should listen at http://127.0.0.1:3000/ by default, -# but you can use the HOST and PORT environment variables to override this +# but you can use the IP and PORT environment variables to override this ``` diff --git a/src/main.rs b/src/main.rs index 4ae840a..c887edd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -136,7 +136,7 @@ async fn main() { .or(warb::path::end().and(warb::fs::file("frontend/index.html"))) .or(warb::fs::dir("frontend")); - let host = std::env::var("HOST") + let ip = std::env::var("IP") .ok() .and_then(|s| s.parse::().ok()) .unwrap_or_else(|| [127, 0, 0, 1].into()); @@ -145,6 +145,6 @@ async fn main() { .and_then(|s| s.parse::().ok()) .unwrap_or(3000); - println!("Listening at http://{}:{} ...", &host, &port); - warb::serve(routes).run((host, port)).await; + println!("Listening at http://{}:{} ...", &ip, &port); + warb::serve(routes).run((ip, port)).await; }