feat(avatars): add bind_url env variable

This commit is contained in:
alyssa 2024-11-08 10:16:38 +09:00
parent 299be27031
commit 543522440a
2 changed files with 4 additions and 1 deletions

View file

@ -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,

View file

@ -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();