about summary refs log tree commit diff
path: root/src/http/middlewares.go
blob: 66258cdf726f2d7288f84feb5edf28090517359c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package http

import (
	"net/http"

	"github.com/sirupsen/logrus"
)

func loggingMiddleware(next http.Handler) http.Handler {
	return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
		// Do stuff here
		logrus.Debugf("%s %s", r.Method, r.RequestURI)
		// Call the next handler, which can be another middleware in the chain, or the final handler.
		next.ServeHTTP(w, r)
	})
}