Skip to content

Commit

Permalink
Merge pull request #282 from jmlgo/master
Browse files Browse the repository at this point in the history
route required by the new version of the iOS app
  • Loading branch information
nemunaire authored Dec 19, 2023
2 parents 034f2e4 + e49644b commit e5daa61
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions internal/app/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ func (app *App) registerRoutes(router *gin.Engine) {
"webapp": endpoint,
})
})
router.GET("/discovery/v1/webapp", func(c *gin.Context) {
endpoint, err := app.MyEndpoint()
if err != nil {
log.Warn("endpoint error:", err.Error())
c.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{"err": err.Error()})
return
}
c.JSON(http.StatusOK, gin.H{
"Status": "OK",
"Host": endpoint,
})
})

router.GET("/health", func(c *gin.Context) {
count := app.hub.ClientCount()
Expand Down

0 comments on commit e5daa61

Please sign in to comment.