Skip to content

Commit 64321bb

Browse files
committed
build: add port var
1 parent 82c537e commit 64321bb

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎compose.yml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ services:
1616
OIDC_CLIENT_SECRET: client-secret
1717
RUST_LOG: debug
1818
VOTEIT_URL: 0
19+
PORT: 8080
1920
configs:
2021
- source: nginx.conf
2122
target: /etc/nginx/nginx.conf

‎src/main.rs‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ async fn main() -> std::io::Result<()> {
3333

3434
tokio::spawn(work(db.clone(), rx));
3535

36+
let port = env::var("PORT")
37+
.expect("PORT not found.")
38+
.parse::<u16>()
39+
.unwrap();
40+
3641
HttpServer::new(move || {
3742
App::new()
3843
.app_data(db.clone())
@@ -43,7 +48,7 @@ async fn main() -> std::io::Result<()> {
4348
.service(server::api::onboard_api)
4449
.service(server::api::card_onboard_api)
4550
})
46-
.bind(("0.0.0.0", 8080))?
51+
.bind(("0.0.0.0", port))?
4752
.run()
4853
.await
4954
}

0 commit comments

Comments
 (0)