Small fix with the environment

This commit is contained in:
cdricms
2025-01-18 22:52:49 +00:00
parent 2046a32202
commit b89201014c

View File

@@ -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"),