From b1bc46290f042ee6128850b8a78b03470dbd58aa Mon Sep 17 00:00:00 2001 From: Stephen Adamson Date: Wed, 29 Apr 2026 23:12:54 +0100 Subject: [PATCH] fix: resolve chi route collision on /bookings path Use direct Post with inline middleware instead of Route group to avoid duplicate mount path panic with the existing authenticated /bookings Route. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- backend/main.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/backend/main.go b/backend/main.go index 166d855..db75778 100644 --- a/backend/main.go +++ b/backend/main.go @@ -138,11 +138,7 @@ func main() { }) // Public booking endpoints (optional auth for slot reservation) - r.Route("/bookings", func(r chi.Router) { - r.Use(mw.RateLimit(30, time.Minute)) - r.Use(mw.OptionalAuth) - r.Post("/reserve", bookings.ReserveSlotHandler) - }) + r.With(mw.RateLimit(30, time.Minute), mw.OptionalAuth).Post("/bookings/reserve", bookings.ReserveSlotHandler) // Authenticated users r.Group(func(r chi.Router) {