From 73688038a35d0ceee3d45bd15825a38bb26e74c0 Mon Sep 17 00:00:00 2001 From: mo khan Date: Thu, 26 Jun 2025 14:42:02 -0600 Subject: chore: update the BIND_ADDR variable and read it --- .runway/env-production.yml | 2 +- .runway/env-staging.yml | 2 +- src/main.rs | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.runway/env-production.yml b/.runway/env-production.yml index 6eaecdb8..9d86e025 100644 --- a/.runway/env-production.yml +++ b/.runway/env-production.yml @@ -1,2 +1,2 @@ APP_ENV: "production" -BIND_ADDR: ":http" +BIND_ADDR: "[::1]:50051" diff --git a/.runway/env-staging.yml b/.runway/env-staging.yml index 6eaecdb8..9d86e025 100644 --- a/.runway/env-staging.yml +++ b/.runway/env-staging.yml @@ -1,2 +1,2 @@ APP_ENV: "production" -BIND_ADDR: ":http" +BIND_ADDR: "[::1]:50051" diff --git a/src/main.rs b/src/main.rs index 884460fd..0a1cd5a5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,7 +6,9 @@ async fn main() -> Result<(), Box> { use std::sync::Arc; use tonic::transport::Server; - let addr = "[::1]:50051".parse()?; + let addr = std::env::var("BIND_ADDR") + .unwrap_or_else(|_| "[::1]:50051".to_string()) + .parse()?; let (_health_reporter, health_service) = tonic_health::server::health_reporter(); -- cgit v1.2.3