func handle_work_json(w http.ResponseWriter, req *http.Request, ctx *Context) { mw, err := worker.CurrentWork(ctx.Context) if err != nil { internal_error(w, req, ctx, err) return } if err := send_json(w, mw); err != nil { log.Println("error responding with json:", err) } }
func handle_work_html(w http.ResponseWriter, req *http.Request, ctx *Context) { mw, err := worker.CurrentWork(ctx.Context) if err != nil { internal_error(w, req, ctx, err) } w.Header().Set("Content-Type", "text/html") err = current_template.Execute(w, mw) if err != nil { internal_error(w, req, ctx, err) } }