Skip to content

Commit

Permalink
fix: env getter function gets port value from env var
Browse files Browse the repository at this point in the history
  • Loading branch information
lonnik committed Jun 28, 2024
1 parent cc901ff commit 272f118
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions services/server/pkg/utils/env_vars.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ import (
)

func GetEnv(key string) (string, error) {
port := "8080"
if os.Getenv("PORT") != "" {
port = os.Getenv("PORT")
}

envVars := map[string]string{
"DB_HOST": os.Getenv("DB_HOST"),
"DB_USER": os.Getenv("DB_USER"),
Expand All @@ -22,7 +17,7 @@ func GetEnv(key string) (string, error) {
"REDIS_PORT": os.Getenv("REDIS_PORT"),
"GOOGLE_GEOCODE_API_KEY": os.Getenv("GOOGLE_GEOCODE_API_KEY"),
"HOST": os.Getenv("HOST"),
"PORT": port,
"PORT": os.Getenv("PORT"),
}

val, ok := envVars[key]
Expand Down

0 comments on commit 272f118

Please sign in to comment.