This commit is contained in:
2026-06-23 15:16:50 +08:00
parent d8779ed5bf
commit fe69a2e38b
+3 -1
View File
@@ -137,7 +137,9 @@ func LoadConfig(customPath string) *Config {
// applyDefaults fills zero-value fields with sensible defaults.
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
}
if cfg.Database.Type == "" {