diff --git a/server.js b/server.js index 40689b3..ec87c71 100644 --- a/server.js +++ b/server.js @@ -30,8 +30,8 @@ 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 filePath = path.join(__dirname, req.params.filename); res.download(filePath); });