dev du parc

This commit is contained in:
2026-04-21 18:39:01 +02:00
parent 9e421b1d08
commit 31940e48ba
17 changed files with 1124 additions and 17 deletions

25
server/utils/mysql.js Normal file
View File

@@ -0,0 +1,25 @@
import mysql from "mysql2/promise"
let pool
export function getMysqlPool() {
if (pool) {
return pool
}
const config = useRuntimeConfig()
pool = mysql.createPool({
host: config.mysqlHost,
port: Number(config.mysqlPort || 3306),
database: config.mysqlDatabase,
user: config.mysqlUser,
password: config.mysqlPassword,
waitForConnections: true,
connectionLimit: 10,
queueLimit: 0,
charset: "utf8mb4",
})
return pool
}