Huge refactoring, resolved tight coupling

This commit is contained in:
PB
2024-07-19 21:51:16 +02:00
parent 71a43d17a1
commit a73f2b2921
31 changed files with 563 additions and 477 deletions

View File

@@ -6,21 +6,21 @@ import (
var (
defaultCORS = cors.New(cors.Config{
AllowOrigins: "*",
AllowCredentials: true,
AllowMethods: "GET, POST, PATCH, PUT, DELETE, OPTIONS",
AllowHeaders: "Accept, Authorization, Content-Type, Vary, X-Request-Id",
AllowOrigins: "*",
// AllowCredentials: true,
AllowMethods: "GET, POST, PATCH, PUT, DELETE, OPTIONS",
AllowHeaders: "Accept, Authorization, Content-Type, Vary, X-Request-Id",
})
)
func SetupRouter(s *Server) {
s.Base.Options("*", defaultCORS)
s.Base.Use(defaultCORS)
s.Options("*", defaultCORS)
s.Use(defaultCORS)
s.Base.Get("/health", s.HealthHandler)
s.Base.Get("/config", s.ConfigHandler)
s.Get("/health", s.HealthHandler)
s.Get("/config", s.ConfigHandler)
api := s.Base.Group("/api")
api := s.Group("/api")
v1 := api.Group("/v1")
v1.Post("/login", s.LoginHandler)
v1.All("/traefik", s.TraefikHandler)