25 lines
422 B
Go
Raw Normal View History

2025-02-02 15:11:35 +01:00
package web
import (
"net/http"
"git.kapelle.org/niklas/beerpong-elo/internal/repo"
"github.com/graphql-go/handler"
)
func CreateWebserver(repo repo.Repo) *http.ServeMux {
router := http.NewServeMux()
schema := createShema(repo)
gqlHandler := handler.New(&handler.Config{
Schema: &schema,
Pretty: true,
GraphiQL: true,
})
router.Handle("/graphql", gqlHandler)
initStatic(router)
return router
}