Use the listen port set in the env vars
This commit is contained in:
parent
39163ab050
commit
e48f74b970
1 changed files with 3 additions and 2 deletions
|
@ -17,7 +17,7 @@
|
||||||
use axum::{extract::{MatchedPath, Request}, response::Response, routing::get, Router};
|
use axum::{extract::{MatchedPath, Request}, response::Response, routing::get, Router};
|
||||||
use database::create_connection_pool;
|
use database::create_connection_pool;
|
||||||
use diesel::{r2d2::ConnectionManager, SqliteConnection};
|
use diesel::{r2d2::ConnectionManager, SqliteConnection};
|
||||||
use env::LoadEnvError;
|
use env::{listen_port, LoadEnvError};
|
||||||
use http::routes::auth::auth_router;
|
use http::routes::auth::auth_router;
|
||||||
use r2d2::Pool;
|
use r2d2::Pool;
|
||||||
use tower_http::{classify::ServerErrorsFailureClass, trace::TraceLayer};
|
use tower_http::{classify::ServerErrorsFailureClass, trace::TraceLayer};
|
||||||
|
@ -101,7 +101,8 @@ async fn main() {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
let listener = tokio::net::TcpListener::bind("127.0.0.1:3000")
|
// FIXME(sofia): Add an env var to change the bind addr
|
||||||
|
let listener = tokio::net::TcpListener::bind(format!("0.0.0.0:{}", listen_port()))
|
||||||
.await
|
.await
|
||||||
.expect("failed to bind");
|
.expect("failed to bind");
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue