mirror of
https://github.com/skyle1995/NetworkAuth.git
synced 2026-05-25 02:24:05 +08:00
Add public functions
Fix a large number of bugs Optimize the description information
This commit is contained in:
@@ -98,7 +98,7 @@ func createHTTPServer(addr string) *http.Server {
|
||||
|
||||
// 创建Gin引擎
|
||||
router := gin.New()
|
||||
|
||||
|
||||
// 添加恢复中间件
|
||||
router.Use(gin.Recovery())
|
||||
|
||||
@@ -176,11 +176,11 @@ func startServer(server *http.Server) {
|
||||
func configureGin() {
|
||||
// 禁用Gin的颜色输出,提高控制台兼容性
|
||||
gin.DisableConsoleColor()
|
||||
|
||||
|
||||
// 设置Gin的输出为丢弃,因为我们使用自定义日志中间件
|
||||
gin.DefaultWriter = io.Discard
|
||||
gin.DefaultErrorWriter = io.Discard
|
||||
|
||||
|
||||
// 根据配置设置Gin模式
|
||||
if viper.GetString("app.mode") == "production" {
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
|
||||
Reference in New Issue
Block a user