Skip to content

Commit

Permalink
patch usage of deploy url env
Browse files Browse the repository at this point in the history
Signed-off-by: Vishal <[email protected]>
  • Loading branch information
dvishal485 committed Aug 14, 2024
1 parent c898ff3 commit de11033
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DEPLOYMENT_URL="http://localhost:3000"
DEPLOYMENT_URL="localhost:3000"
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM docker.io/rust:1.73-slim-bullseye as builder
WORKDIR /usr/src/flipkart-scraper-api
RUN apt update && apt install -y libssl-dev
ENV DEPLOYMENT_URL http://localhost:3000
ENV DEPLOYMENT_URL localhost:3000
ENV OPENSSL_LIB_DIR=/usr/lib/x86_64-linux-gnu
ENV OPENSSL_INCLUDE_DIR=/usr/include
COPY Cargo.toml .
Expand Down
6 changes: 4 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ async fn main() {
(StatusCode::PERMANENT_REDIRECT, Redirect::permanent("/")).into_response()
}));

println!("Starting server on port 3000");
let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
println!("Starting server on {}", env!("DEPLOYMENT_URL"));
let listener = tokio::net::TcpListener::bind(env!("DEPLOYMENT_URL"))
.await
.unwrap();
axum::serve(listener, app).await.unwrap();
}

0 comments on commit de11033

Please sign in to comment.