@@ -41,14 +41,15 @@ var httpFlag = flag.String("http", ":8080", "Listen for HTTP connections on this
func main() {
flag.Parse()
var service changes.Service
switch 0 {
switch 2 {
case 0:
cacheTransport := httpcache.NewMemoryCacheTransport()
gerrit, err := gerrit.NewClient("https://go-review.googlesource.com/", &http.Client{Transport: cacheTransport})
//gerrit, err := gerrit.NewClient("https://upspin-review.googlesource.com/", &http.Client{Transport: cacheTransport})
if err != nil {
log.Fatalln(err)
}
service = gerritapi.NewService(gerrit)
@@ -120,11 +121,15 @@ func main() {
req.URL.Path = req.URL.Path[prefixLen:]
if req.URL.Path == "" {
req.URL.Path = "/"
}
//req = req.WithContext(context.WithValue(req.Context(), changesapp.RepoSpecContextKey, "go.googlesource.com/go"))
//req = req.WithContext(context.WithValue(req.Context(), changesapp.RepoSpecContextKey, "go.googlesource.com/tools"))
//req = req.WithContext(context.WithValue(req.Context(), changesapp.RepoSpecContextKey, "upspin.googlesource.com/upspin"))
req = req.WithContext(context.WithValue(req.Context(), changesapp.RepoSpecContextKey, "github.com/google/go-github"))
//req = req.WithContext(context.WithValue(req.Context(), changesapp.RepoSpecContextKey, "github.com/dustin/go-humanize"))
//req = req.WithContext(context.WithValue(req.Context(), changesapp.RepoSpecContextKey, "github.com/neugram/ng"))
req = req.WithContext(context.WithValue(req.Context(), changesapp.BaseURIContextKey, "/changes"))
changesApp.ServeHTTP(w, req)
})
http.Handle("/changes", issuesHandler)
http.Handle("/changes/", issuesHandler)