Skip to content

Instantly share code, notes, and snippets.

@mcandre
Created June 29, 2023 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcandre/31274df478208ac06953a5c598fb214d to your computer and use it in GitHub Desktop.
Save mcandre/31274df478208ac06953a5c598fb214d to your computer and use it in GitHub Desktop.
Expose CORS for local backend development and testing with Google Chrome
func exposeCors(w http.ResponseWriter) {
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "*")
w.Header().Set("Access-Control-Allow-Headers", "*")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment