From f4c47b748e944736f1535e4c479a6b0060c7ff4c Mon Sep 17 00:00:00 2001 From: Blake Ridgway Date: Sat, 29 Nov 2025 13:09:12 -0600 Subject: [PATCH] working on cors --- cmd/server/main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/server/main.go b/cmd/server/main.go index 8f6ed81..f04e526 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -91,6 +91,13 @@ func loggingMiddleware(next http.Handler) http.Handler { } func setupRoutes(r *chi.Mux) { + r.Options("/*", func(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Access-Control-Allow-Origin", "*") + w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS") + w.Header().Set("Access-Control-Allow-Headers", "Accept, Authorization, Content-Type") + w.WriteHeader(http.StatusOK) + }) + // Public routes r.Get("/health", healthCheck)