mirror of
https://github.com/joohoi/acme-dns.git
synced 2025-07-13 17:27:51 +07:00
Added http health check endpoint. (#137)
* Added http health check endpoint. * Fixed performing POST on GET endpoint. * Explicitly return http status 200 in health check endpoint. * Updated changelog.
This commit is contained in:

committed by
Joona Hoikkala

parent
7fbb5261c8
commit
aff13a02fb
@ -71,6 +71,7 @@ func setupRouter(debug bool, noauth bool) http.Handler {
|
||||
Debug: Config.General.Debug,
|
||||
})
|
||||
api.POST("/register", webRegisterPost)
|
||||
api.GET("/health", healthCheck)
|
||||
if noauth {
|
||||
api.POST("/update", noAuth(webUpdatePost))
|
||||
} else {
|
||||
@ -406,3 +407,11 @@ func TestApiManyUpdateWithIpCheckHeaders(t *testing.T) {
|
||||
}
|
||||
Config.API.UseHeader = false
|
||||
}
|
||||
|
||||
func TestApiHealthCheck(t *testing.T) {
|
||||
router := setupRouter(false, false)
|
||||
server := httptest.NewServer(router)
|
||||
defer server.Close()
|
||||
e := getExpect(t, server)
|
||||
e.GET("/health").Expect().Status(http.StatusOK)
|
||||
}
|
||||
|
Reference in New Issue
Block a user