up
This commit is contained in:
+3
-1
@@ -137,7 +137,9 @@ func LoadConfig(customPath string) *Config {
|
|||||||
|
|
||||||
// applyDefaults fills zero-value fields with sensible defaults.
|
// applyDefaults fills zero-value fields with sensible defaults.
|
||||||
func applyDefaults(cfg *Config, defaultPath string) *Config {
|
func applyDefaults(cfg *Config, defaultPath string) *Config {
|
||||||
if cfg.Web.Port == "" {
|
// If the entire web block is empty (old config without "web" key),
|
||||||
|
// fill default port so the app still starts on 8080.
|
||||||
|
if cfg.Web.Port == "" && cfg.Web.Socket == "" {
|
||||||
cfg.Web.Port = defaultPort
|
cfg.Web.Port = defaultPort
|
||||||
}
|
}
|
||||||
if cfg.Database.Type == "" {
|
if cfg.Database.Type == "" {
|
||||||
|
|||||||
Reference in New Issue
Block a user