-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathhandlerRoot.go
More file actions
26 lines (20 loc) · 760 Bytes
/
handlerRoot.go
File metadata and controls
26 lines (20 loc) · 760 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package main
import (
"fmt"
"net/http"
"google.golang.org/appengine"
//"appengine/user"
)
// ========== ========== ========== ========== ==========
func handlerRoot(w http.ResponseWriter, r *http.Request) {
// ========== ========== ========== ========== ==========
// New Context - opaque value used by many functions in the Go App Engine SDK to communicate with the App Engine service
// [START new_context]
ctx := appengine.NewContext(r) // c or ctx
// Send to func via: (c context.Context)
// [END new_context]
// ========== ========== ========== ========== ==========
w.Header().Set("Content-Type", "text/html; charset=utf-8")
fmt.Fprint(w, drawPage(r, ctx))
}
// ========== ========== ========== ========== ==========