From 481c4adfc4aee347c69c5b39c5cf5d2b37dc324b Mon Sep 17 00:00:00 2001 From: PAI-SUPERVVIP Date: Tue, 24 Feb 2026 08:42:43 +0000 Subject: [PATCH 1/2] Update download endpoint to accept filename parameter --- server.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 40689b3..96e20db 100644 --- a/server.js +++ b/server.js @@ -30,8 +30,9 @@ app.get('/', (req, res) => { res.sendFile(path.join(__dirname, 'public', 'index.html')); }); -app.get('/download', (req, res) => { - const filePath = path.join(__dirname, 'test.txt'); +app.get('/download/:filename', (req, res) => { + const path = require('path'); + const filePath = path.join(__dirname, req.params.filename); res.download(filePath); }); From 21dd51d1ba194050c4432d12ab9976dfd8aab9b3 Mon Sep 17 00:00:00 2001 From: PAI-SUPERVVIP Date: Tue, 24 Feb 2026 08:43:30 +0000 Subject: [PATCH 2/2] update /download to accept filename parameter --- server.js | 1 - 1 file changed, 1 deletion(-) diff --git a/server.js b/server.js index 96e20db..ec87c71 100644 --- a/server.js +++ b/server.js @@ -31,7 +31,6 @@ app.get('/', (req, res) => { }); app.get('/download/:filename', (req, res) => { - const path = require('path'); const filePath = path.join(__dirname, req.params.filename); res.download(filePath); });