Created
June 29, 2023 15:43
-
-
Save mcandre/31274df478208ac06953a5c598fb214d to your computer and use it in GitHub Desktop.
Expose CORS for local backend development and testing with Google Chrome
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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