feat: allow bind_address to be modified with env var
This commit is contained in:
parent
43d05fadc4
commit
9ef5feafc7
1 changed files with 3 additions and 2 deletions
|
@ -1,5 +1,6 @@
|
|||
use std::env;
|
||||
use actix_files as fs;
|
||||
use actix_web::{App, HttpServer, middleware};
|
||||
use actix_web::{App, HttpServer, middleware, web};
|
||||
use env_logger;
|
||||
|
||||
mod relay;
|
||||
|
@ -17,7 +18,7 @@ async fn main() -> std::io::Result<()> {
|
|||
.index_file("index.html")
|
||||
)
|
||||
})
|
||||
.bind(("0.0.0.0", 8080))?
|
||||
.bind(env::var("BIND_ADDRESS").unwrap_or(String::from("0.0.0.0:8080")))?
|
||||
.run()
|
||||
.await
|
||||
}
|
Loading…
Reference in a new issue