22 lines
417 B
JavaScript
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;
|