()
| 14 | } |
| 15 | |
| 16 | func main() { |
| 17 | r := chi.NewRouter() |
| 18 | r.Use(middleware.RequestID) |
| 19 | r.Use(middleware.Logger) |
| 20 | r.Get("/", func(w http.ResponseWriter, r *http.Request) { |
| 21 | w.Write([]byte("hello world")) |
| 22 | }) |
| 23 | r.MethodFunc("LINK", "/link", func(w http.ResponseWriter, r *http.Request) { |
| 24 | w.Write([]byte("custom link method")) |
| 25 | }) |
| 26 | r.MethodFunc("WOOHOO", "/woo", func(w http.ResponseWriter, r *http.Request) { |
| 27 | w.Write([]byte("custom woohoo method")) |
| 28 | }) |
| 29 | r.HandleFunc("/everything", func(w http.ResponseWriter, r *http.Request) { |
| 30 | w.Write([]byte("capturing all standard http methods, as well as LINK, UNLINK and WOOHOO")) |
| 31 | }) |
| 32 | http.ListenAndServe(":3333", r) |
| 33 | } |
nothing calls this directly
no test coverage detected