From 189166e2f44ca69537fa632032ec7ab252595d1b Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Sun, 8 May 2022 16:59:33 +0200 Subject: fix: Pick a broader address bind Trying to fixe the following issue from Heroku: > Error R10 (Boot timeout) -> Web process failed to bind to $PORT > within 60 seconds of launch --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 49815b8..1fb0e90 100644 --- a/src/main.rs +++ b/src/main.rs @@ -93,8 +93,8 @@ async fn request(req: Request) -> Result, Infallible> { #[tokio::main] async fn main() { - let port = env::var("PORT").unwrap_or("3000".into()).parse::().unwrap_or(300); - let addr = SocketAddr::from(([127, 0, 0, 1], port)); + let port = env::var("PORT").unwrap_or("3000".into()).parse::().unwrap_or(3000); + let addr = SocketAddr::from(([0, 0, 0, 0], port)); let make_svc = make_service_fn(|_conn| async { Ok::<_, Infallible>(service_fn(request)) -- cgit v1.2.3