mirror of
https://github.com/lordmathis/lemma.git
synced 2025-11-06 07:54:22 +00:00
Remove too many debug messages
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user