Add /api/debug/db-projekte endpoint
Deploy Standortplaner / deploy (push) Successful in 16s
Details
Deploy Standortplaner / deploy (push) Successful in 16s
Details
This commit is contained in:
parent
b81389d180
commit
d5dd3a4d59
13
server.js
13
server.js
|
|
@ -242,6 +242,19 @@ app.get('/api/debug/headers', (req, res) => {
|
|||
});
|
||||
});
|
||||
|
||||
// Debug-Endpunkt um zu sehen, wie die Projekte in der DB heißen
|
||||
app.get('/api/debug/db-projekte', async (req, res) => {
|
||||
const client = await pool.connect();
|
||||
try {
|
||||
const result = await client.query('SELECT id, name FROM geodaten.projekte ORDER BY name');
|
||||
res.json(result.rows);
|
||||
} catch (err) {
|
||||
res.status(500).json({ error: err.message });
|
||||
} finally {
|
||||
client.release();
|
||||
}
|
||||
});
|
||||
|
||||
app.get('/api/logs', (req, res) => {
|
||||
res.type('text/plain').send(serverLogs.join('\n'));
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue