Files

26 lines
648 B
Go
Raw Permalink Normal View History

// Copyright 2017 The Gitea Authors. All rights reserved.
// SPDX-License-Identifier: MIT
package misc
import (
2019-12-20 18:07:12 +01:00
"net/http"
"code.gitea.io/gitea/modules/setting"
2019-05-11 18:21:34 +08:00
"code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/services/context"
)
// Version shows the version of the Gitea server
func Version(ctx *context.APIContext) {
2017-11-12 23:02:25 -08: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 18:07:12 +01:00
ctx.JSON(http.StatusOK, &structs.ServerVersion{Version: setting.AppVer})
}