SimpleCloudNotifier/server/common/ginext/gin.go

22 lines
342 B
Go
Raw Normal View History

2022-11-13 19:17:07 +01:00
package ginext
import (
scn "blackforestbytes.com/simplecloudnotifier"
"github.com/gin-gonic/gin"
)
func NewEngine(cfg scn.Config) *gin.Engine {
engine := gin.New()
engine.RedirectFixedPath = false
engine.RedirectTrailingSlash = false
engine.Use(CorsMiddleware())
if cfg.GinDebug {
engine.Use(gin.Logger())
}
return engine
}