2025-03-19 02:09:30 -06:00
|
|
|
const mysql = require("mysql2");
|
|
|
|
|
|
2025-03-19 04:10:41 -06:00
|
|
|
//Create a pool of connections to allow multiple query happen at the same time
|
2025-03-19 02:09:30 -06:00
|
|
|
const pool = mysql.createPool({
|
|
|
|
|
host: "localhost",
|
|
|
|
|
user: "root",
|
|
|
|
|
database: "marketplace",
|
|
|
|
|
password: "12345678",
|
|
|
|
|
});
|
|
|
|
|
|
2025-03-19 04:10:41 -06:00
|
|
|
//Export a promise for promise-based query
|
2025-03-19 02:09:30 -06:00
|
|
|
module.exports = pool.promise();
|