Backend/lib/db.js
2022-01-20 19:49:05 +05:30

22 lines
417 B
JavaScript

var mysql = require('mysql');
var connection=mysql.createConnection({
host :process.env.DB_HOST,
user :process.env.DB_USER,
password :process.env.DB_PASS,
database :process.env.MYSQL_DB
});
connection.connect(function(error){
if(error)
{
console.log(error);
}
else
{
console.log("Database Connected...");
}
});
module.exports = connection;