MCPcopy Create free account
hub / github.com/archlinux-de/pkgstats-cli / NewServer

Function NewServer

cmd/testhelper_server_test.go:44–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42}
43
44func NewServer() *http.ServeMux {
45 mux := http.NewServeMux()
46 mux.HandleFunc("POST /api/submit", handleSubmit)
47 mux.HandleFunc("GET /api/packages", handlePackages)
48 mux.HandleFunc("GET /api/packages/{package}", handlePackage)
49 return mux
50}
51
52func handleSubmit(w http.ResponseWriter, r *http.Request) {
53 if r.Header.Get("User-Agent") != build.UserAgent {

Callers 1

pkgstatsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected