Skip to content

Commit

Permalink
Add health endpoint
Browse files Browse the repository at this point in the history
Allow us to tell when the server is up and running and can answer
requests
  • Loading branch information
kradalby committed Aug 8, 2021
1 parent bb2ccfd commit 149279f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 149279f

Please sign in to comment.