diff --git a/smalltrip/options.go b/smalltrip/options.go index 172caf8..5c573ce 100644 --- a/smalltrip/options.go +++ b/smalltrip/options.go @@ -17,27 +17,24 @@ package smalltrip import ( "log/slog" - "net/http" - "forge.capytal.company/loreddev/x/tinyssert" + "forge.capytal.company/loreddev/x/smalltrip/middleware" ) type Option func(*router) -func WithAssertions(assertions tinyssert.Assertions) Option { - return func(r *router) { - r.assert = assertions - } -} - func WithLogger(logger *slog.Logger) Option { return func(r *router) { r.log = logger } } -func WithServeMux(mux *http.ServeMux) Option { return func(r *router) { - r.mux = mux + } +} + +func WithMiddleware(m middleware.Middleware) Option { + return func(r *router) { + r.Use(m) } }