fix(api): conditionally set Gin mode to release based on debug flag

This commit is contained in:
yusing
2025-09-02 17:25:11 +08:00
parent 1e090ffa0a
commit 54fb962ce8

View File

@@ -40,7 +40,9 @@ import (
// @externalDocs.description GoDoxy Docs
// @externalDocs.url https://docs.godoxy.dev
func NewHandler() *gin.Engine {
gin.SetMode("release")
if !common.IsDebug {
gin.SetMode("release")
}
r := gin.New()
r.Use(ErrorHandler())
r.Use(ErrorLoggingMiddleware())