Bind to 0.0.0.0 so that it works containerized
This commit is contained in:
parent
8b32c52f90
commit
eff186830a
1 changed files with 4 additions and 4 deletions
|
@ -17,17 +17,17 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|||
*/
|
||||
|
||||
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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue