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:
@@ -22,9 +22,10 @@ type Config struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func LoadConfig() *Config {
|
func LoadConfig() *Config {
|
||||||
|
port := getEnv("SERVER_PORT", "8765")
|
||||||
return &Config{
|
return &Config{
|
||||||
ServerPort: getEnv("SERVER_PORT", "8080"),
|
ServerPort: port,
|
||||||
BaseURL: getEnv("BASE_URL", "http://localhost:8080"),
|
BaseURL: getEnv("BASE_URL", "http://localhost:"+port),
|
||||||
DatabaseHost: getEnv("DATABASE_HOST", "localhost"),
|
DatabaseHost: getEnv("DATABASE_HOST", "localhost"),
|
||||||
DatabasePort: getEnv("DATABASE_PORT", "5432"),
|
DatabasePort: getEnv("DATABASE_PORT", "5432"),
|
||||||
DatabaseUser: getEnv("DATABASE_USER", "postgres"),
|
DatabaseUser: getEnv("DATABASE_USER", "postgres"),
|
||||||
|
|||||||
Reference in New Issue
Block a user