Beispiel #1
0
func init_context(req *http.Request) (c *Context) {
	session, err := store.Get(req, appname)
	if err != nil {
		log.Println("store err:", err)
	}
	c = &Context{
		Session: session,
		Meta:    base_meta.Dup(),
		Data:    d{},
		State:   worker.GetState(),
		Context: worker.NewContext(),
	}

	if req.URL.Path != "/" {
		c.Meta.Nav.SetActive(req.URL.Path)
	}

	return
}
Beispiel #2
0
func handle_status(w http.ResponseWriter, req *http.Request) {
	w.Header().Set("Content-type", "text/plain")
	fmt.Fprint(w, worker.GetState())
}