diff --git a/api/index.js b/api/index.js index 3b9b976..196743e 100644 --- a/api/index.js +++ b/api/index.js @@ -172,6 +172,16 @@ app.get('/api/analytics/sop-compliance', async (req, res) => { } }); +app.get('/api/debug-db', async (req, res) => { + try { + const result = await pool.query('SELECT table_name FROM information_schema.tables WHERE table_schema = \'public\''); + res.json({ status: 'ok', tables: result.rows }); + } catch (err) { + console.error('Debug DB Error:', err); + res.status(500).json({ error: err.message, stack: err.stack }); + } +}); + const PORT = process.env.PORT || 3000; app.listen(PORT, () => { console.log(`Server running on port ${PORT}`);