forgejo/routers/api/forgejo/v1/forgejo.go
Gusted 6f960f23e5
[CLEANUP] Reuse ForgejoVersion variable
- Resolves https://codeberg.org/forgejo/forgejo/issues/1226

(cherry picked from commit e383b70109)
(cherry picked from commit 029cfa34de)
(cherry picked from commit 81392b8c55)
(cherry picked from commit 0ebecca1e6)
(cherry picked from commit aff135418d)
(cherry picked from commit b5982f5008)
(cherry picked from commit 00f86df8f4)
(cherry picked from commit 178908c047)
(cherry picked from commit 9cc57d1b3f)
(cherry picked from commit dc80ba9a97)
(cherry picked from commit 5b2f1d7149)
(cherry picked from commit f0ab85cd06)
2024-02-05 14:45:11 +01:00

23 lines
423 B
Go

// SPDX-License-Identifier: MIT
package v1
import (
"net/http"
"code.gitea.io/gitea/modules/json"
"code.gitea.io/gitea/modules/setting"
)
type Forgejo struct{}
var _ ServerInterface = &Forgejo{}
func NewForgejo() *Forgejo {
return &Forgejo{}
}
func (f *Forgejo) GetVersion(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
_ = json.NewEncoder(w).Encode(Version{&setting.ForgejoVersion})
}