Example #1
0
func init() {
	var err error
	local, err = time.LoadLocation("America/New_York")
	if err != nil {
		panic(err)
	}
	http.Handle("/", webapp.Router)
	webapp.HandleFunc("/", index)
	webapp.HandleFunc("/class", class)
	webapp.Handle("/roster", userContextHandler(webapp.HandlerFunc(roster)))
	if appengine.IsDevAppServer() {
		webapp.HandleFunc("/error", throwError)
	}

	for url, template := range map[string]string{
		"/about":           "templates/about.html",
		"/pricing":         "templates/pricing.html",
		"/privates-groups": "templates/privates-groups.html",
		"/teachers":        "templates/teachers.html",
		"/workshops":       "templates/workshops.html",
		"/mailinglist":     "templates/mailinglist.html",
	} {
		webapp.HandleFunc(url, staticTemplate(template))
	}
}
Example #2
0
func init() {
	webapp.HandleFunc("/admin", userContextHandler(webapp.HandlerFunc(admin)))
	webapp.HandleFunc("/admin/add-staff", userContextHandler(webapp.HandlerFunc(addStaff)))
}