From db6322d9870d087a0d4d7791b085b833659d437b Mon Sep 17 00:00:00 2001 From: James Mills Date: Wed, 25 Mar 2020 07:12:31 +1000 Subject: Add CORS --- app/app.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'app/app.go') diff --git a/app/app.go b/app/app.go index 68bcc51..0ce959c 100644 --- a/app/app.go +++ b/app/app.go @@ -15,6 +15,7 @@ import ( rice "github.com/GeertJohan/go.rice" "github.com/fsnotify/fsnotify" + "github.com/gorilla/handlers" "github.com/gorilla/mux" "github.com/renstrom/shortuuid" log "github.com/sirupsen/logrus" @@ -113,7 +114,7 @@ func (a *App) Run() error { } buildFeed(a) go startWatcher(a) - return http.Serve(a.Listener, a.Router) + return http.Serve(a.Listener, handlers.CORS()(a.Router)) } func (a *App) render(name string, w http.ResponseWriter, ctx interface{}) { -- cgit v1.2.3