diff --git a/routes/videoRoutes.js b/routes/videoRoutes.js index 604c8d5..f9b9381 100644 --- a/routes/videoRoutes.js +++ b/routes/videoRoutes.js @@ -134,14 +134,13 @@ router.get('/videos/file/:video_id', (req, res) => { return res.status(400).json({ error: 'Video not yet produced' }); } - const videoPath = video.video_file; + let videoPath = video.video_file; // Check if the video file exists fs.access(videoPath, fs.constants.F_OK, (err) => { if (err) { console.error('Video file not found:', err); videoPath = dbTester.getCatVideo(); - // return res.status(404).json({ error: 'Video file not found' }); } const stat = fs.statSync(videoPath);