summaryrefslogtreecommitdiffstats
path: root/routers/init.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2022-11-12 19:59:15 +0100
committerGitHub <noreply@github.com>2022-11-12 19:59:15 +0100
commita0a425a13ba587829a831aaecd8469d39d372111 (patch)
tree87a6fa890c33ca253e6b806d412efd2ab276c4a9 /routers/init.go
parentAdjust clone timeout error to suggest increasing timeout (#21769) (diff)
downloadforgejo-a0a425a13ba587829a831aaecd8469d39d372111.tar.xz
forgejo-a0a425a13ba587829a831aaecd8469d39d372111.zip
Add some documentation to packages (#21648)
In #21637 it was mentioned that the purpose of the API routes for the packages is unclear. This PR adds some documentation. Fix #21637 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
Diffstat (limited to 'routers/init.go')
-rw-r--r--routers/init.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/routers/init.go b/routers/init.go
index 53b33f468f..fecc5c439c 100644
--- a/routers/init.go
+++ b/routers/init.go
@@ -185,8 +185,14 @@ func NormalRoutes(ctx context.Context) *web.Route {
r.Mount("/", web_routers.Routes(ctx))
r.Mount("/api/v1", apiv1.Routes(ctx))
r.Mount("/api/internal", private.Routes())
+
if setting.Packages.Enabled {
- r.Mount("/api/packages", packages_router.Routes(ctx))
+ // Add endpoints to match common package manager APIs
+
+ // This implements package support for most package managers
+ r.Mount("/api/packages", packages_router.CommonRoutes(ctx))
+
+ // This implements the OCI API (Note this is not preceded by /api but is instead /v2)
r.Mount("/v2", packages_router.ContainerRoutes(ctx))
}
return r