2017-03-06 07:13:17 -07:00
|
|
|
// 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 (
|
2019-12-20 10:07:12 -07:00
|
|
|
"net/http"
|
|
|
|
|
2017-03-06 07:13:17 -07:00
|
|
|
"code.gitea.io/gitea/modules/context"
|
|
|
|
"code.gitea.io/gitea/modules/setting"
|
2019-05-11 04:21:34 -06:00
|
|
|
"code.gitea.io/gitea/modules/structs"
|
2017-03-06 07:13:17 -07:00
|
|
|
)
|
|
|
|
|
|
|
|
// Version shows the version of the Gitea server
|
|
|
|
func Version(ctx *context.APIContext) {
|
2017-11-13 00:02:25 -07:00
|
|
|
// swagger:operation GET /version miscellaneous getVersion
|
|
|
|
// ---
|
|
|
|
// summary: Returns the version of the Gitea application
|
|
|
|
// produces:
|
|
|
|
// - application/json
|
|
|
|
// responses:
|
|
|
|
// "200":
|
|
|
|
// "$ref": "#/responses/ServerVersion"
|
2019-12-20 10:07:12 -07:00
|
|
|
ctx.JSON(http.StatusOK, &structs.ServerVersion{Version: setting.AppVer})
|
2017-03-06 07:13:17 -07:00
|
|
|
}
|