// pages/api/testDbConnection.js import getPool from "../../utils/mysqlPool"; export default async function handler(req, res) { const pool = getPool(); let connection; try { connection = await pool.getConnection(); const [rows] = await connection.query("SELECT 1 AS test"); console.log("DB-Verbindung erfolgreich! Ergebnis:", rows); res.status(200).json({ success: true, result: rows }); } catch (error) { console.error("DB-Verbindungsfehler:", error); res.status(500).json({ success: false, error: error.message }); } finally { if (connection) connection.release(); } }