forked from Ivasoft/traefik
add PING handler to dashboard API
This commit is contained in:
6
web.go
6
web.go
@@ -52,6 +52,8 @@ func (provider *WebProvider) Provide(configurationChan chan<- types.ConfigMessag
|
||||
// health route
|
||||
systemRouter.Methods("GET").Path("/health").HandlerFunc(provider.getHealthHandler)
|
||||
|
||||
// ping route
|
||||
systemRouter.Methods("GET").Path("/ping").HandlerFunc(provider.getPingHandler)
|
||||
// API routes
|
||||
systemRouter.Methods("GET").Path("/api").HandlerFunc(provider.getConfigHandler)
|
||||
systemRouter.Methods("GET").Path("/api/providers").HandlerFunc(provider.getConfigHandler)
|
||||
@@ -120,6 +122,10 @@ func (provider *WebProvider) getHealthHandler(response http.ResponseWriter, requ
|
||||
templatesRenderer.JSON(response, http.StatusOK, metrics.Data())
|
||||
}
|
||||
|
||||
func (provider *WebProvider) getPingHandler(response http.ResponseWriter, request *http.Request) {
|
||||
fmt.Fprintf(response, "OK")
|
||||
}
|
||||
|
||||
func (provider *WebProvider) getConfigHandler(response http.ResponseWriter, request *http.Request) {
|
||||
currentConfigurations := provider.server.currentConfigurations.Get().(configs)
|
||||
templatesRenderer.JSON(response, http.StatusOK, currentConfigurations)
|
||||
|
||||
Reference in New Issue
Block a user