From 149279f3d5ae777dbe5adbfb238767d98ad398f0 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Sun, 8 Aug 2021 17:36:25 +0100 Subject: [PATCH] Add health endpoint Allow us to tell when the server is up and running and can answer requests --- app.go | 1 + 1 file changed, 1 insertion(+) diff --git a/app.go b/app.go index 363b38bc..91605c03 100644 --- a/app.go +++ b/app.go @@ -157,6 +157,7 @@ func (h *Headscale) watchForKVUpdatesWorker() { // Serve launches a GIN server with the Headscale API func (h *Headscale) Serve() error { r := gin.Default() + r.GET("/health", func(c *gin.Context) { c.JSON(200, gin.H{"healthy": "ok"}) }) r.GET("/key", h.KeyHandler) r.GET("/register", h.RegisterWebAPI) r.POST("/machine/:id/map", h.PollNetMapHandler)