Remove spurious ping route
parent
c89e4ab857
commit
54f1c3432f
|
@ -55,8 +55,6 @@ func NewMux(opts MuxOpts, service Service) http.Handler {
|
|||
router.GET("/docs", Redoc("/swagger.json"))
|
||||
|
||||
/* API */
|
||||
router.GET("/chronograf/v1/ping", service.Ping)
|
||||
|
||||
// Sources
|
||||
router.GET("/chronograf/v1/sources", service.Sources)
|
||||
router.POST("/chronograf/v1/sources", service.NewSource)
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
package server
|
||||
|
||||
import "net/http"
|
||||
|
||||
// Ping responds with HTTP status 204 (no content)
|
||||
func (h *Service) Ping(w http.ResponseWriter, r *http.Request) {
|
||||
w.WriteHeader(http.StatusNoContent)
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
package server
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestPingStatus(t *testing.T) {
|
||||
req := httptest.NewRequest("GET", "http://hoverboards.com", nil)
|
||||
w := httptest.NewRecorder()
|
||||
srv := Service{}
|
||||
srv.Ping(w, req)
|
||||
resp := w.Result()
|
||||
if resp.StatusCode != http.StatusNoContent {
|
||||
t.Errorf("TestPingStatus got status code %d want %d", resp.StatusCode, http.StatusNoContent)
|
||||
}
|
||||
}
|
||||
|
||||
func TestPingTokenRefresh(t *testing.T) {
|
||||
|
||||
}
|
|
@ -33,7 +33,6 @@ type getRoutesResponse struct {
|
|||
Mappings string `json:"mappings"` // Location of the application mappings endpoint
|
||||
Sources string `json:"sources"` // Location of the sources endpoint
|
||||
Me string `json:"me"` // Location of the me endpoint
|
||||
Ping string `json:"ping"` // Location of the ping endpoint
|
||||
Dashboards string `json:"dashboards"` // Location of the dashboards endpoint
|
||||
Auth []AuthRoute `json:"auth"` // Location of all auth routes.
|
||||
}
|
||||
|
@ -46,7 +45,6 @@ func AllRoutes(authRoutes []AuthRoute, logger chronograf.Logger) http.HandlerFun
|
|||
Me: "/chronograf/v1/me",
|
||||
Mappings: "/chronograf/v1/mappings",
|
||||
Dashboards: "/chronograf/v1/dashboards",
|
||||
Ping: "/chronograf/v1/ping",
|
||||
Auth: make([]AuthRoute, len(authRoutes)),
|
||||
}
|
||||
|
||||
|
|
|
@ -27,8 +27,4 @@ func TestAllRoutes(t *testing.T) {
|
|||
if err := json.Unmarshal(body, &routes); err != nil {
|
||||
t.Error("TestAllRoutes not able to unmarshal JSON response")
|
||||
}
|
||||
if routes.Ping != "/chronograf/v1/ping" {
|
||||
t.Errorf("TestAllRoutes ping got %s want %s", routes.Ping, "/chronograf/v1/ping")
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue