working on cors
This commit is contained in:
@@ -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)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user