Son aktivite 1 month ago

mila bu gisti düzenledi 2 years ago. Düzenlemeye git

Değişiklik yok

mila bu gisti düzenledi 2 years ago. Düzenlemeye git

1 file changed, 2 insertions

gistfile1.txt yeniden adlandırıldı http-metrics.go

@@ -1,5 +1,7 @@
1 1 import "github.com/felixge/httpsnoop"
2 2
3 + handler := http.StripPrefix("/path/", http.FileServer(http.Dir("/tmp/files/")))
4 +
3 5 wrappedHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
4 6 metrics := httpsnoop.CaptureMetrics(handler, w, r)
5 7 slog.Info(fmt.Sprintf("%v %v", r.Method, r.URL), "code", metrics.Code)

mila bu gisti düzenledi 2 years ago. Düzenlemeye git

1 file changed, 6 insertions

gistfile1.txt(dosya oluşturuldu)

@@ -0,0 +1,6 @@
1 + import "github.com/felixge/httpsnoop"
2 +
3 + wrappedHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
4 + metrics := httpsnoop.CaptureMetrics(handler, w, r)
5 + slog.Info(fmt.Sprintf("%v %v", r.Method, r.URL), "code", metrics.Code)
6 + })
Daha yeni Daha eski