Fix BaseURL construction to use consistent port

- Use SERVER_PORT for both port and BaseURL construction
- Ensures BaseURL matches the actual server port
This commit is contained in:
2026-01-30 20:16:25 -05:00
parent a9fdd44471
commit 6432d4cb00
+3 -2
View File
@@ -22,9 +22,10 @@ type Config struct {
}
func LoadConfig() *Config {
port := getEnv("SERVER_PORT", "8765")
return &Config{
ServerPort: getEnv("SERVER_PORT", "8080"),
BaseURL: getEnv("BASE_URL", "http://localhost:8080"),
ServerPort: port,
BaseURL: getEnv("BASE_URL", "http://localhost:"+port),
DatabaseHost: getEnv("DATABASE_HOST", "localhost"),
DatabasePort: getEnv("DATABASE_PORT", "5432"),
DatabaseUser: getEnv("DATABASE_USER", "postgres"),