added permissive cors

This commit is contained in:
2023-12-17 15:53:26 +01:00
parent bbf11a826d
commit f76fba0b05
3 changed files with 5 additions and 0 deletions

View File

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