MCPcopy Create free account
hub / github.com/cloud-native-go/examples / loggingMiddleware

Method loggingMiddleware

ch08/hexarch/frontend/rest.go:50–55  ·  view source on GitHub ↗
(next http.Handler)

Source from the content-addressed store, hash-verified

48}
49
50func (f *restFrontEnd) loggingMiddleware(next http.Handler) http.Handler {
51 return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
52 log.Println(r.Method, r.RequestURI)
53 next.ServeHTTP(w, r)
54 })
55}
56
57func (f *restFrontEnd) notAllowedHandler(w http.ResponseWriter, r *http.Request) {
58 http.Error(w, "Not Allowed", http.StatusMethodNotAllowed)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected