summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-06-26 14:42:02 -0600
committermo khan <mo@mokhan.ca>2025-06-26 14:42:02 -0600
commit73688038a35d0ceee3d45bd15825a38bb26e74c0 (patch)
tree39ab688e48bbd131b0105fcef31b18890bd5c6cc
parent031d4ba92e69966ae91bbebd9ec797e6c115c2f0 (diff)
chore: update the BIND_ADDR variable and read it
-rw-r--r--.runway/env-production.yml2
-rw-r--r--.runway/env-staging.yml2
-rw-r--r--src/main.rs4
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<dyn std::error::Error>> {
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();