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.
This commit is contained in:
@@ -44,35 +44,6 @@ app.get('/health', (req, res) => {
|
|||||||
res.json({ status: 'ok', timestamp: new Date().toISOString() });
|
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
|
// API Routes
|
||||||
app.use('/api/reports', reportRoutes);
|
app.use('/api/reports', reportRoutes);
|
||||||
app.use('/api/events', eventRoutes);
|
app.use('/api/events', eventRoutes);
|
||||||
|
|||||||
Reference in New Issue
Block a user