drive-health/lib/web/net.go

27 lines
464 B
Go
Raw Permalink Normal View History

package web
import (
"github.com/gin-gonic/gin"
"tea.chunkbyte.com/kato/drive-health/lib/config"
)
func SetupRouter() *gin.Engine {
// Initialize the Gin engine
cfg := config.GetConfiguration()
r := gin.Default()
2024-01-21 22:50:50 +02:00
// Set gin to release
gin.SetMode(gin.ReleaseMode)
r.Use(BasicAuthMiddleware(cfg.IdentityUsername, cfg.IdentityPassword))
// Setup Health Pings
setupHealth(r)
// Setup Api
setupApi(r)
// Setup Frontend
setupFrontend(r)
return r
}