MCPcopy
hub / github.com/OJ/gobuster / main

Function main

vhs/server.go:37–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

35}
36
37func main() {
38 x := RegexpHandler{}
39 x.routes = append(x.routes, &route{regexp.MustCompile(`^/\w+-\w+-\w+-\w+-\w+$`), http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
40 w.WriteHeader(http.StatusNotFound)
41 })})
42 x.routes = append(x.routes, &route{regexp.MustCompile(`^/`), http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
43 w.WriteHeader(http.StatusOK)
44 if _, err := w.Write([]byte(r.URL.Path)); err != nil {
45 log.Fatal(err.Error())
46 }
47 })})
48
49 log.Fatal(http.ListenAndServe("127.0.0.1:8081", &x)) // nolint:gosec
50}

Callers

nothing calls this directly

Calls 2

FatalMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected