From def38d739b71e91127e7ff7717e3001f10fe744a Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Tue, 26 Mar 2024 07:45:48 -0400 Subject: [PATCH] file paths fix --- index.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index 6c13dd6..494d1f8 100644 --- a/index.js +++ b/index.js @@ -51,14 +51,15 @@ app.get('/videos/:filename', (req, res)=>{ const filePath = videoFileMap[fileName] - if(!filePath){ - console.log("Finding File Not Found ", filePath); + const completeFile = process.env.COMMON_MEDIA_PATH + filePath; + if(!completeFile){ + console.log("Finding File Not Found ", completeFile); return res.status(404).send('File not found') } - console.log("Finding File Found ", filePath); + console.log("Finding File Found ", completeFile); + - const completeFile = process.env.COMMON_MEDIA_PATH + filePath; const stat = fs.statSync(completeFile); const fileSize = stat.size;