gddo-server: Remove /-/index.

The index page has little usage since the new search supports search by
paths, directories. It also loads all packages into memory, which slows
down the entire server and eats up the memory we have.

Fixes #451, #407.

Change-Id: I99332695fdd287193d926426661beac40469ac8b
Reviewed-on: https://go-review.googlesource.com/32550
Reviewed-by: Stephen Weinberg <stephenmw@google.com>
diff --git a/gddo-server/assets/templates/home.html b/gddo-server/assets/templates/home.html
index dfdcd32..b0e3747 100644
--- a/gddo-server/assets/templates/home.html
+++ b/gddo-server/assets/templates/home.html
@@ -24,7 +24,6 @@
   <div class="col-sm-6">
     <h4>More Packages</h4>
     <ul class="list-unstyled">
-      <li><a href="/-/index">Index</a>
       <li><a href="/-/go">Go Standard Packages</a>
       <li><a href="/-/subrepo">Go Sub-repository Packages</a>
       <li><a href="https://golang.org/wiki/Projects">Projects @ go-wiki</a>
diff --git a/gddo-server/assets/templates/index.html b/gddo-server/assets/templates/index.html
deleted file mode 100644
index a3768dc..0000000
--- a/gddo-server/assets/templates/index.html
+++ /dev/null
@@ -1,12 +0,0 @@
-{{define "Head"}}<title>Index - GoDoc</title><meta name="robots" content="NOINDEX">{{end}}
-
-{{define "Body"}}
-  <h1>Index</h1>
-  <p>The following is a list of '<a
-    href="http://golang.org/cmd/go/#hdr-Download_and_install_packages_and_dependencies">go
-    get</a>'able packages on godoc.org. A <a href="/-/go">list of Go standard packages</a> is also available.
-
-  {{htmlComment "\nPlease use http://api.godoc.org/packages instead of scraping this page.\n"}}
-  {{template "Pkgs" .pkgs}}
-  <p>Number of packages: {{len .pkgs}}.
-{{end}}
diff --git a/gddo-server/assets/templates/layout.html b/gddo-server/assets/templates/layout.html
index acdc59a..d69482e 100644
--- a/gddo-server/assets/templates/layout.html
+++ b/gddo-server/assets/templates/layout.html
@@ -21,7 +21,6 @@
   <div class="collapse navbar-collapse">
     <ul class="nav navbar-nav">
         <li{{if equal "home.html" templateName}} class="active"{{end}}><a href="/">Home</a></li>
-        <li{{if equal "index.html" templateName}} class="active"{{end}}><a href="/-/index">Index</a></li>
         <li{{if equal "about.html" templateName}} class="active"{{end}}><a href="/-/about">About</a></li>
     </ul>
     <form class="navbar-nav navbar-form navbar-right" id="x-search" action="/" role="search"><input class="form-control" id="x-search-query" type="text" name="q" placeholder="Search"></form>
diff --git a/gddo-server/assets/templates/notfound.html b/gddo-server/assets/templates/notfound.html
index 7a99c38..538a537 100644
--- a/gddo-server/assets/templates/notfound.html
+++ b/gddo-server/assets/templates/notfound.html
@@ -6,6 +6,5 @@
   <p>Oh snap! Our team of gophers could not find the web page you are looking for. Try one of these pages:
   <ul>
     <li><a href="/">Home</a>
-    <li><a href="/-/index">Package Index</a>
   </ul>
 {{end}}
diff --git a/gddo-server/main.go b/gddo-server/main.go
index 8e69e26..6807e91 100644
--- a/gddo-server/main.go
+++ b/gddo-server/main.go
@@ -466,16 +466,6 @@
 	})
 }
 
-func serveIndex(resp http.ResponseWriter, req *http.Request) error {
-	pkgs, err := db.Index()
-	if err != nil {
-		return err
-	}
-	return executeTemplate(resp, "index.html", http.StatusOK, nil, map[string]interface{}{
-		"pkgs": pkgs,
-	})
-}
-
 func runReindex(resp http.ResponseWriter, req *http.Request) {
 	fmt.Fprintln(resp, "Reindexing...")
 	go reindex()
@@ -915,7 +905,6 @@
 		{"importers.html", "common.html", "layout.html"},
 		{"importers_robot.html", "common.html", "layout.html"},
 		{"imports.html", "common.html", "layout.html"},
-		{"index.html", "common.html", "layout.html"},
 		{"notfound.html", "common.html", "layout.html"},
 		{"pkg.html", "common.html", "layout.html"},
 		{"results.html", "common.html", "layout.html"},
@@ -985,11 +974,9 @@
 	mux.Handle("/-/bot", handler(serveBot))
 	mux.Handle("/-/go", handler(serveGoIndex))
 	mux.Handle("/-/subrepo", handler(serveGoSubrepoIndex))
-	mux.Handle("/-/index", handler(serveIndex))
 	mux.Handle("/-/refresh", handler(serveRefresh))
 	mux.Handle("/-/admin/reindex", http.HandlerFunc(runReindex))
 	mux.Handle("/-/admin/purgeindex", http.HandlerFunc(runPurgeIndex))
-	mux.Handle("/a/index", http.RedirectHandler("/-/index", http.StatusMovedPermanently))
 	mux.Handle("/about", http.RedirectHandler("/-/about", http.StatusMovedPermanently))
 	mux.Handle("/favicon.ico", staticServer.FileHandler("favicon.ico"))
 	mux.Handle("/google3d2f3cd4cc2bb44b.html", staticServer.FileHandler("google3d2f3cd4cc2bb44b.html"))