fix: add CORS access header

This commit is contained in:
Victor Westerlund 2022-07-20 04:38:11 +02:00
parent 3829b395cb
commit 4825c3c9a1

View file

@ -64,7 +64,9 @@ func getSheetData(sheet *RawSheetData) string {
// Create JSON response from sheet data
func httpResponse(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Access-Control-Allow-Origin", "*");
w.Header().Set("Content-Type", "application/json");
fmt.Fprint(w, getSheetData(sheetDataToStruct()))
}