MCPcopy Create free account
hub / github.com/vercel/examples / handleIndex

Method handleIndex

go/api/internal/handler/handler.go:32–44  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

30}
31
32func (h *Handler) handleIndex(w http.ResponseWriter, r *http.Request) {
33 if r.URL.Path != "/" {
34 http.NotFound(w, r)
35 return
36 }
37 data, err := h.assets.ReadFile("public/index.html")
38 if err != nil {
39 http.NotFound(w, r)
40 return
41 }
42 w.Header().Set("Content-Type", "text/html; charset=utf-8")
43 w.Write(data)
44}
45
46func (h *Handler) handleFavicon(w http.ResponseWriter, r *http.Request) {
47 data, err := h.assets.ReadFile("public/favicon.ico")

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected