Skip to content

Commit ea20bb7

Browse files
committed
Set postgres url from env
1 parent 4fdc615 commit ea20bb7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ async fn main() {
3737
.with(tracing_subscriber::fmt::layer())
3838
.init();
3939

40-
let url = "postgres://postgres:postgres@127.0.0.1:5432/iop";
40+
let url = std::env::var("POSTGRES_URL")
41+
.unwrap_or_else(|| "postgres://postgres:postgres@127.0.0.1:5432/iop".to_owned());
4142
let pool = Pool::connect(url)
4243
.await
4344
.expect("Unable to connect to database");

0 commit comments

Comments
 (0)