+11
-1
src/main.rs
+11
-1
src/main.rs
···
25
25
26
26
#[actix_web::main]
27
27
async fn main() -> std::io::Result<()> {
28
+
let host = std::env::var("HOST").unwrap_or(String::from("127.0.0.1"));
29
+
let port = std::env::var("PORT")
30
+
.map(|x| x.parse::<u16>().unwrap_or(60000))
31
+
.unwrap_or(60000);
32
+
33
+
println!(
34
+
"Starting http server on POST http://{}:{}/notify",
35
+
host, port
36
+
);
37
+
28
38
HttpServer::new(|| App::new().service(notify))
29
-
.bind(("127.0.0.1", 3000))?
39
+
.bind((host, port))?
30
40
.run()
31
41
.await
32
42
}