Spaces:
No application file
No application file
| const express = require('express'); | |
| const path = require('path'); | |
| const app = express(); | |
| const PORT = 5000; | |
| // Replace with the actual path to your ZIP file | |
| const zipFilePath = path.join(__dirname, 'app.zip'); | |
| app.post('/download', (req, res) => { | |
| res.download(zipFilePath, 'downloaded.zip', (err) => { | |
| if (err) { | |
| console.error('Download failed:', err); | |
| res.status(500).send('Failed to download file.'); | |
| } | |
| }); | |
| }); | |
| app.listen(PORT, () => { | |
| console.log(`Server is running at http://localhost:${PORT}`); | |
| }); | |