diff --git a/src/main.rs b/src/main.rs index 5a0dfd1..00f1cb8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -17,7 +17,7 @@ pub static DATA_STORAGE: &str = "storage/"; pub static BIND_ADDR: LazyLock = LazyLock::new(|| match env::var("BIND_ADDR") { Ok(addr) => { println!("Binding to address: {}", addr); - addr.parse().unwrap_or("0.0.0.0".to_string()) + addr.parse().unwrap_or("127.0.0.1".to_string()) } Err(_) => { println!("Binding to default address: 0.0.0.0"); @@ -25,8 +25,14 @@ pub static BIND_ADDR: LazyLock = LazyLock::new(|| match env::var("BIND_A } }); pub static BIND_PORT: LazyLock = LazyLock::new(|| match env::var("BIND_PORT") { - Ok(port_str) => port_str.parse().unwrap_or(8080), - Err(_) => 8080, + Ok(port_str) => { + println!("Binding to port: {}", port_str); + port_str.parse().unwrap_or(8080) + } + Err(_) => { + println!("Binding to default port: 8080"); + 8080 + } }); pub static STATIC_PAGES: LazyLock> = LazyLock::new(|| { @@ -79,6 +85,7 @@ async fn main() -> std::io::Result<()> { let _ = fs::create_dir_all(LOG_DIR); println!("Starting server at http://{}:{}/", *BIND_ADDR, *BIND_PORT); + tokio::spawn(async { let mut interval = tokio::time::interval(tokio::time::Duration::from_secs(60)); loop {