working on cors

This commit is contained in:
Blake Ridgway
2025-11-29 13:09:12 -06:00
parent 92f264aeff
commit f4c47b748e

View File

@@ -91,6 +91,13 @@ func loggingMiddleware(next http.Handler) http.Handler {
} }
func setupRoutes(r *chi.Mux) { 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 // Public routes
r.Get("/health", healthCheck) r.Get("/health", healthCheck)