From 1cf29727bc802fc868e6cc00e040c64969ec68a3 Mon Sep 17 00:00:00 2001 From: nea Date: Fri, 25 Nov 2022 19:25:17 +0100 Subject: Allow port config --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index cbb97ee..616a2e5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -76,12 +76,14 @@ async fn wrap_error(arc: Arc, req: Request) -> anyhow::Result anyhow::Result<()> { let token = env::var("TOKEN")?; + let portstr = env::var("PORT")?; + let port = portstr.parse::()?; println!("Running with token: {}", token); let https = HttpsConnector::new(); let client = Client::builder() .build::<_, Body>(https); let arc = Arc::new(Ctx { client, token }); - let addr = SocketAddr::from(([127, 0, 0, 1], 3000)); + let addr = SocketAddr::from(([127, 0, 0, 1], port)); let service = make_service_fn(|_conn| { let carc = Arc::clone(&arc); async move { -- cgit