- update: service port env variable to just be named service_port

This commit is contained in:
2025-03-18 11:57:39 -04:00
parent 8e39c42046
commit 89a1e93dc3
9 changed files with 25 additions and 16 deletions

View File

@@ -8,12 +8,10 @@ use crate::character_db_client::CharacterDbClient;
use crate::character_service::character::character_service_server::CharacterServiceServer;
use crate::character_service::MyCharacterService;
use dotenv::dotenv;
use std::collections::HashMap;
use std::env;
use std::str::FromStr;
use std::sync::Arc;
use tracing::Level;
use utils::consul_registration;
use utils::service_discovery::{get_kube_service_endpoints_by_dns};
#[tokio::main]
@@ -28,7 +26,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Set the gRPC server address
let addr = env::var("LISTEN_ADDR").unwrap_or_else(|_| "0.0.0.0".to_string());
let port = env::var("CHARACTER_SERVICE_PORT").unwrap_or_else(|_| "50053".to_string());
let port = env::var("SERVICE_PORT").unwrap_or_else(|_| "50053".to_string());
let db_url = format!("http://{}",get_kube_service_endpoints_by_dns("database-service","tcp","database-service").await?.get(0).unwrap());