Skip to content

Commit

Permalink
Add v2 write + query endpoints
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Quackenbush <[email protected]>
  • Loading branch information
danquack committed Mar 1, 2022
1 parent 760201b commit a1735d9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit a1735d9

Please sign in to comment.