mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-13 06:40:41 +00:00
Refactoring: simplify version generation. Rename API to /api/version. #167
This commit is contained in:
+2
-4
@@ -12,9 +12,7 @@ import (
|
|||||||
// 3. SnapshotCollection
|
// 3. SnapshotCollection
|
||||||
// 4. PublishedRepoCollection
|
// 4. PublishedRepoCollection
|
||||||
|
|
||||||
// GET /api
|
// GET /api/version
|
||||||
func apiVersion(c *gin.Context) {
|
func apiVersion(c *gin.Context) {
|
||||||
api := make(map[string]string)
|
c.JSON(200, gin.H{"Version": aptly.Version})
|
||||||
api["Version"] = aptly.Version
|
|
||||||
c.JSON(200, api)
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-1
@@ -16,8 +16,9 @@ func Router(c *ctx.AptlyContext) http.Handler {
|
|||||||
router.Use(gin.ErrorLogger())
|
router.Use(gin.ErrorLogger())
|
||||||
|
|
||||||
root := router.Group("/api")
|
root := router.Group("/api")
|
||||||
|
|
||||||
{
|
{
|
||||||
root.GET("/", apiVersion)
|
root.GET("/version", apiVersion)
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user