aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorGabriel A. Giovanini <mail@gabrielgio.me>2022-05-08 16:59:33 +0200
committerGabriel A. Giovanini <mail@gabrielgio.me>2022-05-08 16:59:33 +0200
commit189166e2f44ca69537fa632032ec7ab252595d1b (patch)
tree29c109a47d3f8afc4f8414851821cd76be7a74c6 /src/main.rs
parentcc9fada4aa00b219c962ebb9b86437c7b6ca0c38 (diff)
downloadmacroblog.rs-189166e2f44ca69537fa632032ec7ab252595d1b.tar.gz
macroblog.rs-189166e2f44ca69537fa632032ec7ab252595d1b.tar.bz2
macroblog.rs-189166e2f44ca69537fa632032ec7ab252595d1b.zip
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
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs4
1 files 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<Body>) -> Result<Response<Body>, Infallible> {
#[tokio::main]
async fn main() {
- let port = env::var("PORT").unwrap_or("3000".into()).parse::<u16>().unwrap_or(300);
- let addr = SocketAddr::from(([127, 0, 0, 1], port));
+ let port = env::var("PORT").unwrap_or("3000".into()).parse::<u16>().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))