Remove too many debug messages

This commit is contained in:
2024-12-19 22:00:42 +01:00
parent 0aa67f5cc2
commit b065938211
26 changed files with 75 additions and 586 deletions

View File

@@ -31,7 +31,6 @@ func setupRouter(o Options) *chi.Mux {
r.Use(middleware.Timeout(30 * time.Second))
// Security headers
logging.Debug("setting up security headers")
r.Use(secure.New(secure.Options{
SSLRedirect: false,
SSLProxyHeaders: map[string]string{"X-Forwarded-Proto": "https"},
@@ -39,7 +38,6 @@ func setupRouter(o Options) *chi.Mux {
}).Handler)
// CORS if origins are configured
logging.Debug("setting up CORS")
if len(o.Config.CORSOrigins) > 0 {
r.Use(cors.Handler(cors.Options{
AllowedOrigins: o.Config.CORSOrigins,
@@ -52,7 +50,6 @@ func setupRouter(o Options) *chi.Mux {
}
// Initialize auth middleware and handler
logging.Debug("setting up authentication middleware")
authMiddleware := auth.NewMiddleware(o.JWTManager, o.SessionManager, o.CookieService)
handler := &handlers.Handler{
DB: o.Database,
@@ -60,14 +57,12 @@ func setupRouter(o Options) *chi.Mux {
}
if o.Config.IsDevelopment {
logging.Debug("setting up Swagger docs")
r.Get("/swagger/*", httpSwagger.Handler(
httpSwagger.URL("/swagger/doc.json"), // The URL pointing to API definition
))
}
// API routes
logging.Debug("setting up API routes")
r.Route("/api/v1", func(r chi.Router) {
// Rate limiting for API routes
if o.Config.RateLimitRequests > 0 {
@@ -154,7 +149,6 @@ func setupRouter(o Options) *chi.Mux {
})
// Handle all other routes with static file server
logging.Debug("setting up static file server")
r.Get("/*", handlers.NewStaticHandler(o.Config.StaticPath).ServeHTTP)
return r