mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-09-08 12:49:13 +02:00
Add the same auth check and middlewares as the /v1/ API. It require to export some variable from /v1 API, i am not sure if is the correct way to do Co-authored-by: oliverpool <git@olivier.pfad.fr> Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2582 Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org> Reviewed-by: Gusted <gusted@noreply.codeberg.org> Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org> Co-authored-by: Ada <ada@gnous.eu> Co-committed-by: Ada <ada@gnous.eu>
20 lines
369 B
Go
20 lines
369 B
Go
// Copyright 2023 The Forgejo Authors. All rights reserved.
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
package v1
|
|
|
|
import (
|
|
"code.gitea.io/gitea/modules/web"
|
|
"code.gitea.io/gitea/routers/api/shared"
|
|
)
|
|
|
|
func Routes() *web.Route {
|
|
m := web.NewRoute()
|
|
|
|
m.Use(shared.Middlewares()...)
|
|
|
|
forgejo := NewForgejo()
|
|
m.Get("", Root)
|
|
m.Get("/version", forgejo.GetVersion)
|
|
return m
|
|
}
|