Add analytics page

This commit is contained in:
2025-01-10 19:13:02 -05:00
parent 3a178a3e87
commit 8d5173761c
11 changed files with 1346 additions and 18 deletions

View File

@@ -0,0 +1,21 @@
const mysql = require('mysql2/promise');
let pool;
function initPool(config) {
pool = mysql.createPool(config);
return pool;
}
async function getConnection() {
if (!pool) {
throw new Error('Database pool not initialized');
}
return pool.getConnection();
}
module.exports = {
initPool,
getConnection,
getPool: () => pool
};