passed/routes/logger.go
2024-11-09 12:59:42 +01:00

13 lines
249 B
Go

package routes
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)
}
}