From eff186830a8ee16bc6a771ab2dc4ca27085034d3 Mon Sep 17 00:00:00 2001 From: Martin Brodbeck Date: Wed, 16 Apr 2025 11:31:36 +0200 Subject: [PATCH] Bind to 0.0.0.0 so that it works containerized --- src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index f4f3bdc..e4ecac4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,17 +17,17 @@ along with this program. If not, see . */ use axum::{ + Json, Router, extract::{Path, State}, http::HeaderMap, http::StatusCode, routing::get, routing::post, routing::put, - Json, Router, }; use serde::{Deserialize, Serialize}; -use serde_json::{json, Value}; -use sqlx::{postgres::PgPoolOptions, PgExecutor, PgPool}; +use serde_json::{Value, json}; +use sqlx::{PgExecutor, PgPool, postgres::PgPoolOptions}; use std::env; use std::time::{Duration, SystemTime, UNIX_EPOCH}; @@ -85,7 +85,7 @@ async fn main() { .route("/version", get(version)) .with_state(db_pool); - let mut bind_with = "127.0.0.1:".to_owned(); + let mut bind_with = "0.0.0.0:".to_owned(); bind_with += &listen_port; let listener = tokio::net::TcpListener::bind(bind_with).await.unwrap(); axum::serve(listener, app).await.unwrap();