From 7bc4e9b846396f132c45e23df70817c89e739d59 Mon Sep 17 00:00:00 2001 From: Derek Wright Date: Thu, 18 Dec 2025 13:40:38 -0500 Subject: [PATCH] fix middleware --- server/options.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/options.go b/server/options.go index f7a183f..14dda02 100644 --- a/server/options.go +++ b/server/options.go @@ -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) } +}