Switched mysql from connection to pool, Replaced connect-flash with build-in code
This commit is contained in:
@@ -1,21 +1,13 @@
|
||||
const mysql = require('mysql2');
|
||||
var mysql = require('mysql2/promise');
|
||||
|
||||
var connection = mysql.createConnection({
|
||||
const DBPool = mysql.createPool({
|
||||
host : 'localhost',
|
||||
database : 'testing',
|
||||
user : 'root',
|
||||
password : ''
|
||||
waitForConnections: true,
|
||||
connectionLimit: 10,
|
||||
queueLimit: 0
|
||||
});
|
||||
|
||||
connection.connect(function(error){
|
||||
if(error)
|
||||
{
|
||||
throw error;
|
||||
}
|
||||
else
|
||||
{
|
||||
console.log('MySQL Database is connected Successfully');
|
||||
}
|
||||
});
|
||||
|
||||
module.exports = connection;
|
||||
module.exports = DBPool;
|
||||
Reference in New Issue
Block a user