Related Posts with Thumbnails

Ulllu Video Top <Reliable × STRATEGY>

useEffect(() => { axios.get('/api/videos/top') .then(response => { setVideos(response.data); }) .catch(error => { console.error(error); }); }, []);

app.get('/api/videos/top', (req, res) => { videosCollection.find({}) .sort({ views: -1, likes: -1, comments: -1, shares: -1 }) .limit(10) .toArray((err, videos) => { if (err) { console.error(err); res.status(500).send({ message: 'Error retrieving videos' }); } else { res.send(videos); } }); }); } }); import React, { useState, useEffect } from 'react'; import axios from 'axios'; ulllu video top

function VideoList() { const [videos, setVideos] = useState([]); useEffect(() =&gt; { axios