aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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 {