From 519b9904d892f9e3e54920377c58f62fefbb7383 Mon Sep 17 00:00:00 2001 From: "Gabriel A. Giovanini" Date: Sun, 15 May 2022 16:25:13 +0200 Subject: fix: Make actix follow PORT envvar The server needs to follow `POST` envvar for heroku's sake. --- src/bin/actix.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/bin/actix.rs b/src/bin/actix.rs index dd03ece..c2f81fe 100644 --- a/src/bin/actix.rs +++ b/src/bin/actix.rs @@ -23,12 +23,13 @@ async fn posts(name: web::Path) -> impl Responder { #[actix_web::main] async fn main() -> std::io::Result<()> { + let port = env::var("PORT").unwrap_or("3000".into()).parse::().unwrap_or(3000); HttpServer::new(|| { App::new() .service(index) .service(posts) }) - .bind(("0.0.0.0", 3000))? + .bind(("0.0.0.0", port))? .run() .await } -- cgit v1.2.3