diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index 441e79e..d7c4838 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -19,10 +19,12 @@
-
-
+
-
+
+
+
+
@@ -69,7 +71,7 @@
-
+
@@ -170,7 +172,8 @@
-
+
+
true
@@ -192,10 +195,10 @@
-
+
-
+
@@ -248,10 +251,10 @@
-
+
-
+
diff --git a/app.yaml b/app.yaml
index 3b09099..fd8baf2 100644
--- a/app.yaml
+++ b/app.yaml
@@ -1,5 +1,5 @@
application: musicserver
-version: 2.0.0
+version: 2.0.1
runtime: go115
api_version: go1
diff --git a/musicFacade.go b/musicFacade.go
index 8089f91..dec90eb 100644
--- a/musicFacade.go
+++ b/musicFacade.go
@@ -163,6 +163,7 @@ func getPreviousSong() string {
}
func musicHandler(w http.ResponseWriter, r *http.Request) {
+ (w).Header().Set("Access-Control-Allow-Origin", "*")
if r.URL.Path == "/music" && r.Method == http.MethodGet {
song := r.URL.Query().Get("song")
if song == "" {
diff --git a/musicserver.go b/musicserver.go
index faccbe4..3395a52 100644
--- a/musicserver.go
+++ b/musicserver.go
@@ -100,14 +100,19 @@ type SongData struct {
}
func indexHandler(w http.ResponseWriter, r *http.Request) {
+ (w).Header().Set("Access-Control-Allow-Origin", "*")
if r.URL.Path == "/version" {
w.Header().Add("Content-Type", "application/json")
testf()
- data := VersionData{Version: "2.0.0",
- Changelog: "Rebuilt the application in Go.",
+ data := VersionData{Version: "2.0.1",
+ Changelog: "Fixed CORS",
History: []VersionData{
+ {
+ Version: "2.0.0",
+ Changelog: "Rebuilt the application in Go.",
+ },
{
Version: "1.2.0",
Changelog: "Made the /sync endpoint async. " +
diff --git a/syncFacade.go b/syncFacade.go
index fada799..3450a74 100644
--- a/syncFacade.go
+++ b/syncFacade.go
@@ -12,6 +12,7 @@ import (
)
func syncHandler(w http.ResponseWriter, r *http.Request) {
+ (w).Header().Set("Access-Control-Allow-Origin", "*")
if r.URL.Path == "/sync" {
w.Header().Add("Content-Type", "application/json")
syncGames()