diff options
author | nea <romangraef@gmail.com> | 2022-11-25 19:25:17 +0100 |
---|---|---|
committer | nea <romangraef@gmail.com> | 2022-11-25 19:25:17 +0100 |
commit | 1cf29727bc802fc868e6cc00e040c64969ec68a3 (patch) | |
tree | 0f2f4e1facd2bc9da6831be9c39ab1d9558fa832 /src | |
parent | 0b73cea97df4f65de1d0e42dcd2687d538aa2c3c (diff) | |
download | discordavatarproxy-1cf29727bc802fc868e6cc00e040c64969ec68a3.tar.gz discordavatarproxy-1cf29727bc802fc868e6cc00e040c64969ec68a3.tar.bz2 discordavatarproxy-1cf29727bc802fc868e6cc00e040c64969ec68a3.zip |
Allow port config
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 4 |
1 files changed, 3 insertions, 1 deletions
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<Ctx>, req: Request<Body>) -> anyhow::Result<Respons #[tokio::main] async fn main() -> anyhow::Result<()> { let token = env::var("TOKEN")?; + let portstr = env::var("PORT")?; + let port = portstr.parse::<u16>()?; 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 { |