From b89201014c49cd3abcf971e8c25c60999ffa0411 Mon Sep 17 00:00:00 2001 From: cdricms Date: Sat, 18 Jan 2025 22:52:49 +0000 Subject: [PATCH] Small fix with the environment --- backend/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/main.go b/backend/main.go index 4bbeb6e..f96b0fd 100644 --- a/backend/main.go +++ b/backend/main.go @@ -42,14 +42,16 @@ func main() { port := os.Getenv("BACKEND_DOCKER_PORT") hostname := os.Getenv("DATABASE_HOSTNAME") + postgres_port := os.Getenv("POSTGRES_DOCKER_PORT") if environ == "DEV" { port = os.Getenv("BACKEND_PORT") hostname = "localhost" + postgres_port = os.Getenv("POSTGRES_PORT") } dsn := core.DSN{ Hostname: hostname, - Port: os.Getenv("POSTGRES_PORT"), + Port: postgres_port, DBName: os.Getenv("POSTGRES_DB"), User: os.Getenv("POSTGRES_USER"), Password: os.Getenv("POSTGRES_PASSWORD"),