From 1ebdbd9694de0746dd0860ffb88f25559794665b Mon Sep 17 00:00:00 2001 From: Michael Yang Date: Thu, 12 Oct 2023 15:45:07 -0700 Subject: [PATCH] server: add version handler --- server/routes.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/routes.go b/server/routes.go index bc8ea804..42203cb6 100644 --- a/server/routes.go +++ b/server/routes.go @@ -782,6 +782,9 @@ func Serve(ln net.Listener, allowOrigins []string) error { }) r.Handle(method, "/api/tags", ListModelsHandler) + r.Handle(method, "/api/version", func(c *gin.Context) { + c.JSON(http.StatusOK, gin.H{"version": version.Version}) + }) } log.Printf("Listening on %s (version %s)", ln.Addr(), version.Version)