service/library/httpengine/httpengine.go

18 lines
333 B
Go

package httpengine
import (
"github.com/gin-gonic/gin"
"service/library/logger"
"service/library/middleware"
)
func NewRouter() *gin.Engine {
gin.SetMode(gin.ReleaseMode)
router := gin.New()
router.Use(middleware.LoggerMiddleware(gin.LoggerConfig{}))
router.Use(gin.RecoveryWithWriter(logger.Global.Out))
return router
}