added permissive cors
This commit is contained in:
2
main.go
2
main.go
@@ -9,6 +9,7 @@ import (
|
||||
"github.com/coreos/go-systemd/v22/activation"
|
||||
"github.com/go-chi/chi/v5"
|
||||
"github.com/go-chi/chi/v5/middleware"
|
||||
"github.com/go-chi/cors"
|
||||
"github.com/go-chi/render"
|
||||
_ "github.com/jackc/pgx/v4/stdlib"
|
||||
log "github.com/sirupsen/logrus"
|
||||
@@ -93,6 +94,7 @@ func main() {
|
||||
r.Use(middleware.Recoverer)
|
||||
r.Use(middleware.Timeout(60 * time.Second))
|
||||
r.Use(render.SetContentType(render.ContentTypeJSON))
|
||||
r.Use(cors.AllowAll().Handler)
|
||||
|
||||
// routes
|
||||
r.Get("/stats", GetStats)
|
||||
|
Reference in New Issue
Block a user