From e49644b2250c772d66d7beae91452344b0c0af47 Mon Sep 17 00:00:00 2001 From: JM <16480649+jmlgo@users.noreply.github.com> Date: Tue, 19 Dec 2023 21:54:25 +0100 Subject: [PATCH] route required by the new version of the iOS app --- internal/app/routes.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/internal/app/routes.go b/internal/app/routes.go index 6791bf2e..9a7513ec 100644 --- a/internal/app/routes.go +++ b/internal/app/routes.go @@ -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()