| Index: appengine/chromium_build_stats/default/app.go
|
| diff --git a/appengine/chromium_build_stats/default/app.go b/appengine/chromium_build_stats/default/app.go
|
| index a10e070fd511595c47d81252bdc3f55c70c08e0f..10366d2583b82ad9b2a62ceb2f98c8de69ca2993 100644
|
| --- a/appengine/chromium_build_stats/default/app.go
|
| +++ b/appengine/chromium_build_stats/default/app.go
|
| @@ -8,14 +8,42 @@ package chromiumbuildstats
|
| import (
|
| "fmt"
|
| "net/http"
|
| + "strings"
|
| +)
|
| +
|
| +const (
|
| + topHTML = `
|
| +<html>
|
| +<head><title>chromium-build-stats</title></head>
|
| +<body>
|
| +<h1>chromium-build-stats</h1>
|
| +<form action="/">
|
| +<label for="gsuri">gs URI:</label><input type="text" name="gsuri" />
|
| +<input type="submit" value="submit"><input type="reset">
|
| +</form>
|
| +
|
| +<hr />
|
| +See <a href="https://docs.google.com/a/chromium.org/document/d/16TdPTIIZbtAarXZIMJdiT9CePG5WYCrdxm5u9UuHXNY/edit?pli=1#heading=h.xgjl2srtytjt">design doc</a>
|
| +</body>
|
| +</html>
|
| +`
|
| )
|
|
|
| func init() {
|
| http.HandleFunc("/", handler)
|
| +
|
| }
|
|
|
| -func handler(w http.ResponseWriter, r *http.Request) {
|
| +func handler(w http.ResponseWriter, req *http.Request) {
|
| + gsuri := req.FormValue("gsuri")
|
| + if gsuri != "" {
|
| + if strings.HasPrefix(gsuri, "gs://chrome-goma-log") {
|
| + http.Redirect(w, req, "/ninja_log"+strings.TrimPrefix(gsuri, "gs://chrome-goma-log"), http.StatusSeeOther)
|
| + return
|
| + }
|
| + http.NotFound(w, req)
|
| + return
|
| + }
|
| w.Header().Set("Content-Type", "text/html")
|
| - fmt.Fprintf(w, `<p>Under construction.
|
| -See <a href="https://docs.google.com/a/chromium.org/document/d/16TdPTIIZbtAarXZIMJdiT9CePG5WYCrdxm5u9UuHXNY/edit?pli=1#heading=h.xgjl2srtytjt">design doc</a>`)
|
| + fmt.Fprintf(w, topHTML)
|
| }
|
|
|