mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-30 02:43:05 +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 changed files with 1 additions and 0 deletions
1
app.go
1
app.go
|
@ -157,6 +157,7 @@ func (h *Headscale) watchForKVUpdatesWorker() {
|
||||||
// Serve launches a GIN server with the Headscale API
|
// Serve launches a GIN server with the Headscale API
|
||||||
func (h *Headscale) Serve() error {
|
func (h *Headscale) Serve() error {
|
||||||
r := gin.Default()
|
r := gin.Default()
|
||||||
|
r.GET("/health", func(c *gin.Context) { c.JSON(200, gin.H{"healthy": "ok"}) })
|
||||||
r.GET("/key", h.KeyHandler)
|
r.GET("/key", h.KeyHandler)
|
||||||
r.GET("/register", h.RegisterWebAPI)
|
r.GET("/register", h.RegisterWebAPI)
|
||||||
r.POST("/machine/:id/map", h.PollNetMapHandler)
|
r.POST("/machine/:id/map", h.PollNetMapHandler)
|
||||||
|
|
Loading…
Reference in a new issue