HerzaJ commited on
Commit
88607d7
·
verified ·
1 Parent(s): f808192

Update index.js

Browse files
Files changed (1) hide show
  1. index.js +11 -0
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();