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

Method RegisterRoutes

go/api/internal/handler/handler.go:22–30  ·  view source on GitHub ↗
(mux *http.ServeMux)

Source from the content-addressed store, hash-verified

20}
21
22func (h *Handler) RegisterRoutes(mux *http.ServeMux) {
23 publicFS, _ := fs.Sub(h.assets, "public")
24 mux.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.FS(publicFS))))
25
26 mux.HandleFunc("/", h.handleIndex)
27 mux.HandleFunc("/favicon.ico", h.handleFavicon)
28 mux.HandleFunc("/api/data", h.handleGetData)
29 mux.HandleFunc("/api/items/", h.handleGetItem)
30}
31
32func (h *Handler) handleIndex(w http.ResponseWriter, r *http.Request) {
33 if r.URL.Path != "/" {

Callers 1

mainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected