|
@ -7,6 +7,7 @@ import ( |
|
|
"git.aiterp.net/lucifer3/server/events" |
|
|
"git.aiterp.net/lucifer3/server/events" |
|
|
"git.aiterp.net/lucifer3/server/services/uistate" |
|
|
"git.aiterp.net/lucifer3/server/services/uistate" |
|
|
"github.com/labstack/echo/v4" |
|
|
"github.com/labstack/echo/v4" |
|
|
|
|
|
"github.com/labstack/echo/v4/middleware" |
|
|
"log" |
|
|
"log" |
|
|
"net" |
|
|
"net" |
|
|
"sync" |
|
|
"sync" |
|
@ -18,6 +19,7 @@ func New(addr string) (lucifer3.Service, error) { |
|
|
e := echo.New() |
|
|
e := echo.New() |
|
|
e.HideBanner = true |
|
|
e.HideBanner = true |
|
|
e.HidePort = true |
|
|
e.HidePort = true |
|
|
|
|
|
e.Use(middleware.CORS()) |
|
|
|
|
|
|
|
|
e.GET("/state", func(c echo.Context) error { |
|
|
e.GET("/state", func(c echo.Context) error { |
|
|
svc.mu.Lock() |
|
|
svc.mu.Lock() |
|
|