From c3598e145d815c9c017d5c769b6f328c4b606b0d Mon Sep 17 00:00:00 2001 From: techno-tanoC Date: Tue, 6 Apr 2021 00:16:25 +0900 Subject: [PATCH] fix cors --- server/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/main.go b/server/main.go index 09ecbc3..574f93e 100644 --- a/server/main.go +++ b/server/main.go @@ -24,6 +24,7 @@ func main() { downloader := NewDownloader(client, storage, 1000, 1000) r := gin.Default() + r.Use(cors.Default()) r.GET("/downloads", func(c *gin.Context) { items := downloader.table.ToItems() @@ -50,6 +51,5 @@ func main() { c.JSON(http.StatusNoContent, gin.H{}) }) - r.Use(cors.Default()) r.Run() }