aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornea <romangraef@gmail.com>2022-11-25 19:25:17 +0100
committernea <romangraef@gmail.com>2022-11-25 19:25:17 +0100
commit1cf29727bc802fc868e6cc00e040c64969ec68a3 (patch)
tree0f2f4e1facd2bc9da6831be9c39ab1d9558fa832
parent0b73cea97df4f65de1d0e42dcd2687d538aa2c3c (diff)
downloaddiscordavatarproxy-1cf29727bc802fc868e6cc00e040c64969ec68a3.tar.gz
discordavatarproxy-1cf29727bc802fc868e6cc00e040c64969ec68a3.tar.bz2
discordavatarproxy-1cf29727bc802fc868e6cc00e040c64969ec68a3.zip
Allow port config
-rw-r--r--src/main.rs4
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 {