diff options
| author | James Mills <prologic@shortcircuit.net.au> | 2020-03-25 07:12:31 +1000 |
|---|---|---|
| committer | James Mills <prologic@shortcircuit.net.au> | 2020-03-25 07:12:31 +1000 |
| commit | db6322d9870d087a0d4d7791b085b833659d437b (patch) | |
| tree | 0c364e2be16b3abda1182371f53700dab03e0fc9 /app/app.go | |
| parent | df0f19eee50c4007d322b5069852a54ffd09bc92 (diff) | |
Add CORS
Diffstat (limited to 'app/app.go')
| -rw-r--r-- | app/app.go | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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{}) { |
