summaryrefslogtreecommitdiff
path: root/admin.go
diff options
context:
space:
mode:
authordev <navdgo@gmail.com>2019-06-05 13:10:19 -0400
committerdev <navdgo@gmail.com>2019-06-07 11:40:25 -0400
commit37da91cfe703bc9f14ddec007092d39610a02861 (patch)
treeeba734f11c16b85418a78cc3afe47f0c63b60ece /admin.go
parentb79f86f256782be139d4ec09a74e0f75da52876a (diff)
fix module import paths and add cors to admin endpoints
fix go module refs and add cors to admin endpoints
Diffstat (limited to 'admin.go')
-rw-r--r--admin.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/admin.go b/admin.go
index b3d012b..511ab01 100644
--- a/admin.go
+++ b/admin.go
@@ -13,6 +13,8 @@ import (
"strings"
"sync"
"time"
+
+ "github.com/rs/cors"
)
var (
@@ -46,8 +48,10 @@ func StartAdmin(addr string) error {
mux.Handle(route.Pattern, route)
}
+ handler := cors.Default().Handler(mux)
+
cfgEndptSrv = &http.Server{
- Handler: mux,
+ Handler: handler,
ReadTimeout: 5 * time.Second,
ReadHeaderTimeout: 5 * time.Second,
IdleTimeout: 5 * time.Second,