diff --git a/setup/base.go b/setup/base.go index acbf2d35..fd4e96f0 100644 --- a/setup/base.go +++ b/setup/base.go @@ -26,6 +26,7 @@ import ( "github.com/matrix-org/dendrite/internal/caching" "github.com/matrix-org/dendrite/internal/httputil" "github.com/matrix-org/gomatrixserverlib" + "github.com/matrix-org/util" "github.com/prometheus/client_golang/prometheus/promhttp" "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" @@ -311,6 +312,17 @@ func (b *BaseDendrite) SetupAndServeHTTP( } } + externalRouter.Handle("/health", + httputil.MakeExternalAPI("health", func(req *http.Request) util.JSONResponse { + return util.JSONResponse{ + Code: http.StatusOK, + JSON: struct { + Versions bool `json:"success"` + }{true}, + } + }), + ).Methods(http.MethodGet) + internalRouter.PathPrefix(httputil.InternalPathPrefix).Handler(b.InternalAPIMux) if b.Cfg.Global.Metrics.Enabled { internalRouter.Handle("/metrics", httputil.WrapHandlerInBasicAuth(promhttp.Handler(), b.Cfg.Global.Metrics.BasicAuth))