From 9ef5feafc7a56bc223ab526e7ab84cbf6912be20 Mon Sep 17 00:00:00 2001 From: Raine Date: Mon, 16 Oct 2023 01:36:01 +0200 Subject: [PATCH] feat: allow bind_address to be modified with env var --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 686d08a..b8d4aaa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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 } \ No newline at end of file