From 19f7cba75af6a7e61c173ba4667dbeba041c3d4a Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Mon, 29 May 2023 12:49:38 -0700 Subject: [PATCH] Listen on all interfaces in dev --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 193cfa0..051845f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -166,7 +166,11 @@ async fn serve(posts: &[Post], pool: SqlitePool) { .fallback(get_service(articles_or_fallback)) .layer(Extension(pool)); - let addr = SocketAddr::from(([127, 0, 0, 1], 8084)); + let addr = if cfg!(debug_assertions) { + SocketAddr::from(([0, 0, 0, 0], 8084)) + } else { + SocketAddr::from(([127, 0, 0, 1], 8084)) + }; info!("Listening on {}", addr); axum::Server::bind(&addr) .serve(app.into_make_service())