internal/frontend: serve /sitemap

Add a /sitemap route to the server, serving the private/sitemap
directory.

This is currently handled by App Engine's static routing feature,
but if we switch to Cloud Run we'll have to do it ourselves.

The server already handles the other paths in the app.yaml file
(actually config/frontend.yaml).

Change-Id: I52da85afc1fbbac7be0c66135ec2e66fceb0fa4b
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/353431
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
diff --git a/.dockerignore b/.dockerignore
index 5b2e51b..a4a325e 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -4,8 +4,9 @@
 node_modules
 # Exclude the private sub-repo...
 private
-# ...except for the config directory.
+# ...except for the config and sitemap directories.
 !private/config
+!private/sitemap
 # Exclude e2e tests.
 e2e
 # Exclude devtools config.
diff --git a/internal/frontend/server.go b/internal/frontend/server.go
index a16d87c..269c34a 100644
--- a/internal/frontend/server.go
+++ b/internal/frontend/server.go
@@ -138,6 +138,7 @@
 	handle("/favicon.ico", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
 		http.ServeFile(w, r, fmt.Sprintf("%s/shared/icon/favicon.ico", http.Dir(s.staticPath.String())))
 	}))
+	handle("/sitemap/", http.StripPrefix("/sitemap/", http.FileServer(http.Dir("private/sitemap"))))
 	handle("/mod/", http.HandlerFunc(s.handleModuleDetailsRedirect))
 	handle("/pkg/", http.HandlerFunc(s.handlePackageDetailsRedirect))
 	handle("/fetch/", fetchHandler)