Skip to content

Commit

Permalink
Middleware change (#2976)
Browse files Browse the repository at this point in the history
Added middleware package to fix error with CORS cross origin issue with
dashboard
  • Loading branch information
XandraMcC authored Nov 2, 2023
1 parent 1a225c0 commit 03bba26
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/publicapi/endpoint/requester/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"github.com/bacalhau-project/bacalhau/pkg/requester"
"github.com/gorilla/websocket"
"github.com/labstack/echo/v4"
echo_middleware "github.com/labstack/echo/v4/middleware"
)

type EndpointParams struct {
Expand Down Expand Up @@ -43,6 +44,7 @@ func NewEndpoint(params EndpointParams) *Endpoint {

g := e.router.Group("/api/v1/requester")
g.Use(middleware.SetContentType(echo.MIMEApplicationJSON))
g.Use(echo_middleware.CORS())
g.POST("/list", e.list)
g.GET("/nodes", e.nodes)
g.POST("/states", e.states)
Expand Down

0 comments on commit 03bba26

Please sign in to comment.