From b67fef84ee2e549b2372d1c67e364dc566637ef1 Mon Sep 17 00:00:00 2001 From: Noah Metz Date: Mon, 19 Jun 2023 13:37:59 -0600 Subject: [PATCH] Added FileServer --- gql.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gql.go b/gql.go index 7902d29..72f9dea 100644 --- a/gql.go +++ b/gql.go @@ -1017,7 +1017,9 @@ func (server * GQLServer) Init(abort chan error) bool { http_handler, ws_handler := MakeGQLHandlers(server) mux.HandleFunc("/gql", http_handler) mux.HandleFunc("/gqlws", ws_handler) - mux.HandleFunc("/", GraphiQLHandler()) + mux.HandleFunc("/graphiql", GraphiQLHandler()) + fs := http.FileServer(http.Dir("./site")) + mux.Handle("/site/", http.StripPrefix("/site", fs)) srv := &http.Server{ Addr: server.listen,