summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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();