From e1b536e128e1bb869afb588e932fb72d9ef19ea6 Mon Sep 17 00:00:00 2001 From: Gisle Aune Date: Sat, 14 Jan 2023 14:22:59 +0100 Subject: [PATCH] add cors --- services/httpapiv1/service.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/services/httpapiv1/service.go b/services/httpapiv1/service.go index ad6451e..0885d81 100644 --- a/services/httpapiv1/service.go +++ b/services/httpapiv1/service.go @@ -7,6 +7,7 @@ import ( "git.aiterp.net/lucifer3/server/events" "git.aiterp.net/lucifer3/server/services/uistate" "github.com/labstack/echo/v4" + "github.com/labstack/echo/v4/middleware" "log" "net" "sync" @@ -18,6 +19,7 @@ func New(addr string) (lucifer3.Service, error) { e := echo.New() e.HideBanner = true e.HidePort = true + e.Use(middleware.CORS()) e.GET("/state", func(c echo.Context) error { svc.mu.Lock()