func AppList(w http.ResponseWriter, r *http.Request, u *auth.User) error { apps, err := app.List(u) if err != nil { return err } if len(apps) == 0 { w.WriteHeader(http.StatusNoContent) return nil } return json.NewEncoder(w).Encode(apps) }
func AppList(w http.ResponseWriter, r *http.Request, u *auth.User) error { apps, err := app.List(u) if len(apps) == 0 { w.WriteHeader(http.StatusNoContent) return nil } b, err := json.Marshal(apps) if err != nil { return err } fmt.Fprint(w, string(b)) return nil }
func appList(w http.ResponseWriter, r *http.Request, t *auth.Token) error { u, err := t.User() if err != nil { return err } rec.Log(u.Email, "app-list") apps, err := app.List(u) if err != nil { return err } if len(apps) == 0 { w.WriteHeader(http.StatusNoContent) return nil } return json.NewEncoder(w).Encode(apps) }