tiny 88x31 lexicon for atproto

lol

+3 -2
+3 -2
handler/button.go
··· 32 32 http.Error(w, "error getting buttons!", http.StatusInternalServerError) 33 33 return 34 34 } 35 - encoder := json.NewEncoder(w) 36 35 type Resp struct { 37 36 BtnViews []types.ButtonView `json:"button"` 38 37 Cursor *time.Time `json:"cursor,omitempty"` ··· 45 44 myresp.BtnViews = btnViews 46 45 myresp.Cursor = ncursor 47 46 } 48 - err = encoder.Encode(btnViews) 47 + w.Header().Set("Content-Type", "application/json") 48 + encoder := json.NewEncoder(w) 49 + err = encoder.Encode(myresp) 49 50 if err != nil { 50 51 log.Println(err) 51 52 http.Error(w, "error encoding response", http.StatusInternalServerError)