Skip to content

Commit b96ff58

Browse files
hrissanrazmser
authored andcommitted
helpful documentation for HTTP
1 parent ae1b92a commit b96ff58

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

internal/receiver/receiver_http.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ func (s *HTTP) Serve(h Handler, ln net.Listener) error {
7575
}
7676
_, _ = w.Write([]byte("OK"))
7777
})
78+
handler.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
79+
http.Error(w, "To send events via HTTP, use /api/statshousev1 endpoint and send event is http body. All event formats (JSON, TL, Protobuf, etc.) supported via UDP also work via HTTP.", http.StatusNotFound)
80+
})
7881
server := http.Server{Handler: handler}
7982
log.Printf("Serve HTTP on %s", ln.Addr())
8083
err := server.Serve(ln)

0 commit comments

Comments
 (0)