diff --git a/src/main.rs b/src/main.rs index bf61f11..b32b8db 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,8 +25,18 @@ async fn notify(notification: web::Form) -> impl Responder { #[actix_web::main] async fn main() -> std::io::Result<()> { + let host = std::env::var("HOST").unwrap_or(String::from("127.0.0.1")); + let port = std::env::var("PORT") + .map(|x| x.parse::().unwrap_or(60000)) + .unwrap_or(60000); + + println!( + "Starting http server on POST http://{}:{}/notify", + host, port + ); + HttpServer::new(|| App::new().service(notify)) - .bind(("127.0.0.1", 3000))? + .bind((host, port))? .run() .await }