Chromium Code Reviews| Index: go/src/infra/tricium/service/default/handlers.go |
| diff --git a/go/src/infra/tricium/service/default/handlers.go b/go/src/infra/tricium/service/default/handlers.go |
| index 8f5a67ef99971f60961e6ba26c51cf7d41f72889..c053974ff3585af29d2c7e718c90cd848605b2c0 100644 |
| --- a/go/src/infra/tricium/service/default/handlers.go |
| +++ b/go/src/infra/tricium/service/default/handlers.go |
| @@ -6,11 +6,12 @@ |
| package handlers |
| import ( |
| - "html/template" |
| "net/http" |
| "google.golang.org/appengine" |
| "google.golang.org/appengine/taskqueue" |
| + |
| + common "infra/tricium/service/common" |
|
nodir
2016/07/15 16:38:23
nit: not sure why you put `common ` before path. I
emso
2016/07/19 08:38:44
Not thinking. Removing. Thanks.
|
| ) |
| func init() { |
| @@ -18,14 +19,12 @@ func init() { |
| http.HandleFunc("/analyze", analyzeHandler) |
| } |
| -var basePage = template.Must(template.ParseFiles("templates/base.html")) |
| - |
| func landingPageHandler(w http.ResponseWriter, r *http.Request) { |
| - data := map[string]interface{}{ |
| + d := map[string]interface{}{ |
| "Msg": "This service is under construction ...", |
| "ShowRequestForm": true, |
| } |
| - basePage.Execute(w, data) |
| + common.ShowBasePage(w, d) |
| } |
| func analyzeHandler(w http.ResponseWriter, r *http.Request) { |
| @@ -35,8 +34,8 @@ func analyzeHandler(w http.ResponseWriter, r *http.Request) { |
| http.Error(w, err.Error(), http.StatusInternalServerError) |
| return |
| } |
| - data := map[string]interface{}{ |
| + d := map[string]interface{}{ |
| "Msg": "Dummy analysis request sent.", |
| } |
| - basePage.Execute(w, data) |
| + common.ShowBasePage(w, d) |
| } |