server: add version handler

This commit is contained in:
Michael Yang 2023-10-12 15:45:07 -07:00
parent 5c59455b59
commit 1ebdbd9694

View file

@ -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)