Spaces:
No application file
No application file
File size: 554 Bytes
05a8e6e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
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}`);
});
|