service/library/httpengine/httpengine.go

19 lines
377 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))
router.Use(middleware.TimeoutMiddleware())
return router
}