Huge refactoring, resolved tight coupling
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user