passed/middlewares/logger.go
2024-10-30 10:44:37 +01:00

13 lines
254 B
Go

package middlewares
import (
"log"
"net/http"
)
func Logger(handler http.Handler) http.HandlerFunc {
return func(res http.ResponseWriter, req *http.Request) {
log.Printf("%-30s %s", req.RemoteAddr, req.URL.Path)
handler.ServeHTTP(res, req)
}
}