fix module import paths and add cors to admin endpoints

fix go module refs and add cors to admin endpoints
This commit is contained in:
dev
2019-06-05 13:10:19 -04:00
parent b79f86f256
commit 37da91cfe7
3 changed files with 29 additions and 17 deletions

View File

@ -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,