From a1735d96417e79ac742d89995c3fc1ec2795d017 Mon Sep 17 00:00:00 2001 From: Daniel Quackenbush <25692880+danquack@users.noreply.github.com> Date: Tue, 1 Mar 2022 13:38:40 -0500 Subject: [PATCH] Add v2 write + query endpoints Signed-off-by: Daniel Quackenbush <25692880+danquack@users.noreply.github.com> --- main.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 1348b75..2c8a370 100644 --- a/main.go +++ b/main.go @@ -352,12 +352,15 @@ func main() { go c.serveUdp() http.HandleFunc("/write", c.influxDBPost) + http.HandleFunc("/api/v2/write", c.influxDBPost) // Some InfluxDB clients try to create a database. http.HandleFunc("/query", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, `{"results": []}`) }) - + http.HandleFunc("/api/v2/query", func(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, ``) + }) // Some InfluxDB clients want to check if the http server is an influx endpoint http.HandleFunc("/ping", func(w http.ResponseWriter, r *http.Request) { // InfluxDB returns a 204 on success.