feat: Add env var to change port
This commit is contained in:
parent
94b32f9a1f
commit
9d2f753620
1 changed files with 5 additions and 1 deletions
|
@ -30,7 +30,11 @@ async fn main() -> Result<()> {
|
||||||
let app = routes::router()
|
let app = routes::router()
|
||||||
.layer(Extension(AuthToken(upload_token)));
|
.layer(Extension(AuthToken(upload_token)));
|
||||||
|
|
||||||
axum::Server::bind(&"0.0.0.0:3000".parse().unwrap())
|
let port: u16 = std::env::var("PORT")
|
||||||
|
.map(|s| s.parse().unwrap())
|
||||||
|
.unwrap_or(3000);
|
||||||
|
|
||||||
|
axum::Server::bind(&format!("0.0.0.0:{port}").parse().unwrap())
|
||||||
.serve(app.into_make_service())
|
.serve(app.into_make_service())
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue