Fixed CORS

This commit is contained in:
2020-11-30 21:22:51 +01:00
parent ebaa93b1ea
commit b24c9dca3c
5 changed files with 22 additions and 12 deletions

View File

@@ -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. " +