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)