Remove spurious ping route

pull/1119/head
Jared Scheib 2017-04-03 11:32:56 -07:00
parent c89e4ab857
commit 54f1c3432f
5 changed files with 0 additions and 38 deletions

View File

@ -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)

View File

@ -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)
}

View File

@ -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) {
}

View File

@ -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)),
}

View File

@ -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")
}
}