Modifier la fonction getPathList pour utiliser orderId au lieu de id lors de la récupération des chemins

This commit is contained in:
2025-02-12 11:05:25 +01:00
parent 8b0de65272
commit eb63c84443
4 changed files with 36 additions and 3 deletions

View File

@@ -322,4 +322,31 @@ router.post('/videos/render/:video_id', (req, res) => {
});
});
/**
* @swagger
* /cat:
* get:
* summary: Retrieve a cat video
* responses:
* 200:
* description: A cat video
* content:
* video/mp4:
* schema:
* type: string
* format: binary
* 404:
* description: Video not found
*/
router.get('/cat', (req, res) => {
const videoPath = dbTester.getCatVideo();
fs.access(videoPath, fs.constants.F_OK, (err) => {
if (err) {
console.error('Video not found:', err);
return res.status(404).json({ error: 'Video not found' });
}
res.sendFile(videoPath);
});
});
module.exports = router;