From a6cf6f376464c91e52c6d680ac6581ca9b0748c8 Mon Sep 17 00:00:00 2001 From: Mohan K Date: Tue, 11 Aug 2026 12:48:11 +0530 Subject: [PATCH] Add debug endpoint --- api/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) 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}`);