code.gitea.io/gitea@v1.21.7/routers/api/v1/misc/version.go (about)

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