Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(90)

Side by Side Diff: go/src/infra/tricium/service/default/handlers.go

Issue 2125603002: Adds initial Tricium service GAE configs (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Switches to templates and cleans up garbage from testing Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 package handlers
2
3 import (
4 "html/template"
5 "net/http"
6
7 "appengine"
8 "appengine/taskqueue"
9 )
10
11 func init() {
12 http.HandleFunc("/", landingPageHandler)
13 http.HandleFunc("/analyze", analyzeHandler)
14 }
15
16 var basePage = template.Must(template.ParseFiles("templates/base.html"))
17
18 func landingPageHandler(w http.ResponseWriter, r *http.Request) {
19 data := map[string]interface{}{
20 "Msg": "This service is under construction ...",
21 }
22 basePage.Execute(w, data)
23 }
24
25 func analyzeHandler(w http.ResponseWriter, r *http.Request) {
26 ctx := appengine.NewContext(r)
27 t := taskqueue.NewPOSTTask("/workflow-launcher/queue-handler", map[strin g][]string{"name": {"Analyze Request"}})
28 if _, err := taskqueue.Add(ctx, t, "workflow-launcher-queue"); err != ni l {
29 http.Error(w, err.Error(), http.StatusInternalServerError)
30 return
31 }
32 data := map[string]interface{}{
33 "Msg": "Dummy analysis request sent.",
34 }
35 basePage.Execute(w, data)
36 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698