gitea源码

version.go 648B

1234567891011121314151617181920212223242526
  1. // Copyright 2017 The Gitea Authors. All rights reserved.
  2. // SPDX-License-Identifier: MIT
  3. package misc
  4. import (
  5. "net/http"
  6. "code.gitea.io/gitea/modules/setting"
  7. "code.gitea.io/gitea/modules/structs"
  8. "code.gitea.io/gitea/services/context"
  9. )
  10. // Version shows the version of the Gitea server
  11. func Version(ctx *context.APIContext) {
  12. // swagger:operation GET /version miscellaneous getVersion
  13. // ---
  14. // summary: Returns the version of the Gitea application
  15. // produces:
  16. // - application/json
  17. // responses:
  18. // "200":
  19. // "$ref": "#/responses/ServerVersion"
  20. ctx.JSON(http.StatusOK, &structs.ServerVersion{Version: setting.AppVer})
  21. }