server: add version handler
This commit is contained in:
parent
5c59455b59
commit
1ebdbd9694
1 changed files with 3 additions and 0 deletions
|
@ -782,6 +782,9 @@ func Serve(ln net.Listener, allowOrigins []string) error {
|
||||||
})
|
})
|
||||||
|
|
||||||
r.Handle(method, "/api/tags", ListModelsHandler)
|
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)
|
log.Printf("Listening on %s (version %s)", ln.Addr(), version.Version)
|
||||||
|
|
Loading…
Reference in a new issue