This commit is contained in:
parent
6f04d7cb7f
commit
d715aa47b3
@ -1,3 +1,5 @@
|
||||
use std::env;
|
||||
|
||||
use axum::{
|
||||
extract::Json,
|
||||
response,
|
||||
@ -30,7 +32,8 @@ async fn main() {
|
||||
.route("/end", post(end));
|
||||
|
||||
debug!("Creating listener");
|
||||
let listener = TcpListener::bind("0.0.0.0:8000").await.unwrap();
|
||||
let port = env::var("PORT").unwrap_or_else(|_| "8000".into());
|
||||
let listener = TcpListener::bind(format!("0.0.0.0:{port}")).await.unwrap();
|
||||
debug!("Starting server");
|
||||
axum::serve(listener, app).await.unwrap();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user