Listen on all interfaces in dev

This commit is contained in:
Shadowfacts 2023-05-29 12:49:38 -07:00
parent 6d412cd511
commit 19f7cba75a
1 changed files with 5 additions and 1 deletions

View File

@ -166,7 +166,11 @@ async fn serve(posts: &[Post<HtmlContent>], pool: SqlitePool) {
.fallback(get_service(articles_or_fallback)) .fallback(get_service(articles_or_fallback))
.layer(Extension(pool)); .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); info!("Listening on {}", addr);
axum::Server::bind(&addr) axum::Server::bind(&addr)
.serve(app.into_make_service()) .serve(app.into_make_service())