mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-23 18:15:26 +00:00
Add health endpoint
Allow us to tell when the server is up and running and can answer requests
This commit is contained in:
parent
bb2ccfddd9
commit
149279f3d5
1
app.go
1
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)
|
||||
|
Loading…
Reference in New Issue
Block a user