You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

version.go 719B

1234567891011121314151617181920212223242526
  1. // Copyright 2017 The Gitea Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package misc
  5. import (
  6. "net/http"
  7. "code.gitea.io/gitea/modules/context"
  8. "code.gitea.io/gitea/modules/setting"
  9. "code.gitea.io/gitea/modules/structs"
  10. )
  11. // Version shows the version of the Gitea server
  12. func Version(ctx *context.APIContext) {
  13. // swagger:operation GET /version miscellaneous getVersion
  14. // ---
  15. // summary: Returns the version of the Gitea application
  16. // produces:
  17. // - application/json
  18. // responses:
  19. // "200":
  20. // "$ref": "#/responses/ServerVersion"
  21. ctx.JSON(http.StatusOK, &structs.ServerVersion{Version: setting.AppVer})
  22. }