Update index.js
Browse files
index.js
CHANGED
|
@@ -591,6 +591,17 @@ app.get('/check-ip', (req, res) => {
|
|
| 591 |
});
|
| 592 |
});
|
| 593 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 594 |
app.get('/api/stats', async (req, res) => {
|
| 595 |
try {
|
| 596 |
const totalUsers = await User.countDocuments();
|
|
|
|
| 591 |
});
|
| 592 |
});
|
| 593 |
|
| 594 |
+
app.get('/tmp/:filename', (req, res) => {
|
| 595 |
+
const filename = req.params.filename;
|
| 596 |
+
const filepath = path.join('/tmp', filename);
|
| 597 |
+
|
| 598 |
+
if (fs.existsSync(filepath)) {
|
| 599 |
+
res.sendFile(filepath);
|
| 600 |
+
} else {
|
| 601 |
+
res.status(404).send('file not found or expired');
|
| 602 |
+
}
|
| 603 |
+
});
|
| 604 |
+
|
| 605 |
app.get('/api/stats', async (req, res) => {
|
| 606 |
try {
|
| 607 |
const totalUsers = await User.countDocuments();
|