fix middleware

This commit is contained in:
2025-12-18 13:40:38 -05:00
parent 1c9688efd0
commit 7bc4e9b846

View File

@@ -2,6 +2,7 @@ package server
import (
"log/slog"
"net/http"
"time"
"github.com/go-chi/chi/v5"
@@ -32,3 +33,7 @@ func WithWriteTimeout(d time.Duration) Option {
func WithIdleTimeout(d time.Duration) Option {
return func(server *Server) { server.idleTimeout = d }
}
func WithMiddleware(mw func(http.Handler) http.Handler) Option {
return func(server *Server) { server.Router.Use(mw) }
}