gddo-server: handle /_ah/ requests on GAE.

Request to /_ah/health will get 200 response. Requests to other /_ah/
will get 404.

Change-Id: I06b809b6ee3144d4a3d0983e132b954765c95c1b
Reviewed-on: https://go-review.googlesource.com/21997
Reviewed-by: Stephen Weinberg <stephenmw@google.com>
diff --git a/gddo-server/main.go b/gddo-server/main.go
index e712a22..ae96c9d 100644
--- a/gddo-server/main.go
+++ b/gddo-server/main.go
@@ -587,6 +587,10 @@
 	return executeTemplate(resp, "bot.html", http.StatusOK, nil, nil)
 }
 
+func serveHealthCheck(resp http.ResponseWriter, req *http.Request) {
+	resp.Write([]byte("Health check: ok\n"))
+}
+
 func logError(req *http.Request, err error, rv interface{}) {
 	if err != nil {
 		var buf bytes.Buffer
@@ -959,6 +963,8 @@
 	mux.Handle("/BingSiteAuth.xml", staticServer.FileHandler("BingSiteAuth.xml"))
 	mux.Handle("/C", http.RedirectHandler("http://golang.org/doc/articles/c_go_cgo.html", http.StatusMovedPermanently))
 	mux.Handle("/code.jquery.com/", http.NotFoundHandler())
+	mux.Handle("/_ah/health", http.HandlerFunc(serveHealthCheck))
+	mux.Handle("/_ah/", http.NotFoundHandler())
 	mux.Handle("/", handler(serveHome))
 
 	cacheBusters.Handler = mux