// LoveRandom return a random value from Loves func LoveRandom(w http.ResponseWriter, rq *http.Request) { r := rand.New(rand.NewSource(time.Now().UnixNano())) ls := love.FindAll() l := ls[r.Intn(len(ls))] responseAsJSON(w, l, http.StatusOK) }
// LoveIndex controller of /loves func LoveIndex(w http.ResponseWriter, r *http.Request) { responseAsJSON(w, love.FindAll(), http.StatusOK) }