Move version definition into command package, include build timestamp, add /api/info endpoint

This commit is contained in:
Dan Sosedoff
2015-05-05 00:34:23 -05:00
parent 0bd5360315
commit c0f3f027ae
6 changed files with 25 additions and 9 deletions

View File

@@ -197,3 +197,13 @@ func GetBookmarks(c *gin.Context) {
bookmarks, err := bookmarks.ReadAll(bookmarks.Path())
serveResult(bookmarks, err, c)
}
func GetInfo(c *gin.Context) {
info := map[string]string{
"version": command.VERSION,
"git_sha": command.GitCommit,
"build_time": command.BuildTime,
}
c.JSON(200, info)
}