polylines tooltip content

This commit is contained in:
ISA
2024-08-10 10:32:37 +02:00
parent b1f7b700ca
commit b7116a1e6f
142 changed files with 14451 additions and 4281 deletions

View File

@@ -0,0 +1,31 @@
// /pages/api/talas_v5_DB/station/getStationNameByIdLD.js
import mysql from "mysql2/promise";
// Verbindungspool-Konfiguration
const pool = mysql.createPool({
host: process.env.DB_HOST,
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
database: process.env.DB_NAME,
port: process.env.DB_PORT,
waitForConnections: true,
connectionLimit: 10,
queueLimit: 0,
});
export default async function handler(req, res) {
if (req.method !== "GET") {
res.setHeader("Allow", ["GET"]);
return res.status(405).end(`Method ${req.method} Not Allowed`);
}
try {
// Verwenden des Verbindungspools, um die Abfrage auszuführen
const [results] = await pool.query("SELECT * FROM location_device");
res.status(200).json(results);
} catch (err) {
console.error("Fehler beim Abrufen der Daten:", err);
res.status(500).json({ error: "Error retrieving data from the database" });
}
}