diff --git a/lib/libpk/src/_config.rs b/lib/libpk/src/_config.rs index c92bcd31..238de032 100644 --- a/lib/libpk/src/_config.rs +++ b/lib/libpk/src/_config.rs @@ -59,6 +59,9 @@ pub struct AvatarsConfig { pub s3: S3Config, pub cdn_url: String, + #[serde(default = "_default_api_addr")] + pub bind_addr: String, + #[serde(default)] pub migrate_worker_count: u32, diff --git a/services/avatars/src/main.rs b/services/avatars/src/main.rs index 1f364fcc..44bbfe69 100644 --- a/services/avatars/src/main.rs +++ b/services/avatars/src/main.rs @@ -199,7 +199,7 @@ async fn main() -> anyhow::Result<()> { .route("/stats", get(stats)) .with_state(state); - let host = "0.0.0.0:3000"; + let host = &config.bind_addr; info!("starting server on {}!", host); let listener = tokio::net::TcpListener::bind(host).await.unwrap(); axum::serve(listener, app).await.unwrap();