feat: implement comprehensive configuration validation and integrate into store loading and server initialization.

This commit is contained in:
CJACK
2026-04-05 21:18:51 +08:00
parent 585d35e592
commit a28c9fb67f
11 changed files with 299 additions and 60 deletions

View File

@@ -3,9 +3,17 @@ package app
import (
"net/http"
"ds2api/internal/config"
"ds2api/internal/server"
)
func NewHandler() http.Handler {
return server.NewApp().Router
app, err := server.NewApp()
if err != nil {
config.Logger.Error("[app] init failed", "error", err)
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
server.WriteUnhandledError(w, err)
})
}
return app.Router
}