diff options
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/api.go | 1 | ||||
-rw-r--r-- | routers/api/v1/misc/version.go | 16 |
2 files changed, 17 insertions, 0 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 9431dac017..611a8f91de 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -232,6 +232,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Group("/v1", func() { // Miscellaneous + m.Get("/version", misc.Version) m.Post("/markdown", bind(api.MarkdownOption{}), misc.Markdown) m.Post("/markdown/raw", misc.MarkdownRaw) diff --git a/routers/api/v1/misc/version.go b/routers/api/v1/misc/version.go new file mode 100644 index 0000000000..92950c19c3 --- /dev/null +++ b/routers/api/v1/misc/version.go @@ -0,0 +1,16 @@ +// Copyright 2017 The Gitea Authors. All rights reserved. +// Use of this source code is governed by a MIT-style +// license that can be found in the LICENSE file. + +package misc + +import ( + "code.gitea.io/gitea/modules/context" + "code.gitea.io/gitea/modules/setting" + "code.gitea.io/sdk/gitea" +) + +// Version shows the version of the Gitea server +func Version(ctx *context.APIContext) { + ctx.JSON(200, &gitea.ServerVersion{Version: setting.AppVer}) +} |