github.com/ActiveState/cli@v0.0.0-20240508170324-6801f60cd051/cmd/state-svc/internal/server/router.go (about) 1 package server 2 3 import ( 4 "github.com/99designs/gqlgen/graphql/playground" 5 "github.com/labstack/echo/v4" 6 ) 7 8 func (s *Server) setupRouting() { 9 s.httpServer.POST("/query", func(c echo.Context) error { 10 s.graphServer.ServeHTTP(c.Response(), c.Request()) 11 return nil 12 }) 13 14 s.httpServer.GET("/", func(c echo.Context) error { 15 playground.Handler("GraphQL", "/query").ServeHTTP(c.Response(), c.Request()) 16 return nil 17 }) 18 }