summaryrefslogtreecommitdiff
path: root/app/app.go
diff options
context:
space:
mode:
authorJames Mills <prologic@shortcircuit.net.au>2020-03-25 07:12:31 +1000
committerJames Mills <prologic@shortcircuit.net.au>2020-03-25 07:12:31 +1000
commitdb6322d9870d087a0d4d7791b085b833659d437b (patch)
tree0c364e2be16b3abda1182371f53700dab03e0fc9 /app/app.go
parentdf0f19eee50c4007d322b5069852a54ffd09bc92 (diff)
Add CORS
Diffstat (limited to 'app/app.go')
-rw-r--r--app/app.go3
1 files changed, 2 insertions, 1 deletions
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{}) {