From 6d0faac5e074a8a4e101da820e7e21a8a6c2ff2d Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Wed, 11 Mar 2026 19:18:53 +0000 Subject: internal: instantiate v1/package/{path} endpoint - Create handler for serving v1 package endpoint. - Create tests to verify endpoint behavior. Change-Id: I72701cb15d83baf4e31ed918c198adf347605a4a Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/754420 LUCI-TryBot-Result: Go LUCI kokoro-CI: kokoro Reviewed-by: Jonathan Amsterdam Auto-Submit: Ethan Lee --- internal/frontend/server.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'internal/frontend') diff --git a/internal/frontend/server.go b/internal/frontend/server.go index 5a554635..49ecd39e 100644 --- a/internal/frontend/server.go +++ b/internal/frontend/server.go @@ -21,6 +21,7 @@ import ( "github.com/google/safehtml/template" "golang.org/x/pkgsite/internal" + "golang.org/x/pkgsite/internal/api" "golang.org/x/pkgsite/internal/config" "golang.org/x/pkgsite/internal/derrors" "golang.org/x/pkgsite/internal/experiment" @@ -235,6 +236,7 @@ func (s *Server) Install(handle func(string, http.Handler), cacher Cacher, authV handle("GET /golang.org/x", s.staticPageHandler("subrepo", "Sub-repositories")) handle("GET /files/", http.StripPrefix("/files", s.fileMux)) handle("GET /vuln/", vulnHandler) + handle("GET /v1/package/", s.errorHandler(api.ServePackage)) handle("/opensearch.xml", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { serveFileFS(w, r, s.staticFS, "shared/opensearch.xml") })) -- cgit v1.3