framework_v2/internal/providers/gin.go

18 lines
363 B
Go
Raw Normal View History

2024-06-13 06:32:33 +00:00
package providers
2024-06-13 07:08:55 +00:00
import (
"framework_v2/internal/access"
2024-06-13 07:36:51 +00:00
ginzap "github.com/gin-contrib/zap"
2024-06-13 07:08:55 +00:00
"github.com/gin-gonic/gin"
2024-06-13 07:36:51 +00:00
"time"
2024-06-13 07:08:55 +00:00
)
func InitGin() {
2024-06-13 07:36:51 +00:00
gin.SetMode(gin.ReleaseMode)
2024-06-13 07:08:55 +00:00
2024-06-13 07:36:51 +00:00
access.Router = gin.New()
2024-06-13 07:17:53 +00:00
2024-06-13 07:36:51 +00:00
access.Router.Use(gin.Recovery(), ginzap.Ginzap(access.Logger, time.RFC3339, true))
access.Router.Use(ginzap.RecoveryWithZap(access.Logger, true))
2024-06-13 07:08:55 +00:00
}