From 46f851368d6d7681102c183774a76a50dc2d60b9 Mon Sep 17 00:00:00 2001 From: Paul Bailey Date: Tue, 18 Nov 2025 01:08:17 +0000 Subject: [PATCH] revert: Remove debug endpoint The issue is that uploaded files don't exist on production server. Files need to be uploaded through production or copied to server. --- server/src/index.ts | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/server/src/index.ts b/server/src/index.ts index 1fdbea2..76684f7 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -44,35 +44,6 @@ app.get('/health', (req, res) => { res.json({ status: 'ok', timestamp: new Date().toISOString() }); }); -// Debug endpoint to check uploads directory -app.get('/debug/uploads', (req, res) => { - const fs = require('fs'); - const uploadDirPath = process.env.UPLOAD_DIR || path.join(process.cwd(), 'uploads'); - - try { - const exists = fs.existsSync(uploadDirPath); - const files = exists ? fs.readdirSync(uploadDirPath) : []; - - res.json({ - uploadDir: uploadDirPath, - exists, - fileCount: files.length, - files: files.slice(0, 10), // Show first 10 files - cwd: process.cwd(), - env: { - UPLOAD_DIR: process.env.UPLOAD_DIR, - NODE_ENV: process.env.NODE_ENV, - } - }); - } catch (error: any) { - res.status(500).json({ - error: error.message, - uploadDir: uploadDirPath, - cwd: process.cwd(), - }); - } -}); - // API Routes app.use('/api/reports', reportRoutes); app.use('/api/events', eventRoutes);