17 lines
340 B
JavaScript
17 lines
340 B
JavaScript
const mysql = require('mysql2/promise');
|
|
const pool = require('../config/database');
|
|
|
|
async function getUsers() {
|
|
const connection = await pool.getConnection();
|
|
try {
|
|
const [rows] = await connection.execute('SELECT * FROM cdn');
|
|
return rows || [];
|
|
} finally {
|
|
connection.release();
|
|
}
|
|
}
|
|
|
|
module.exports = {
|
|
getUsers
|
|
};
|