Backend/lib/db.js

18 lines
413 B
JavaScript
Raw Normal View History

2021-12-31 09:33:23 +00:00
var mysql = require('mysql');
var connection=mysql.createConnection({
2022-01-13 13:52:20 +00:00
host :process.env.DB_HOST,
user :process.env.DB_USER,
password :process.env.DB_PASS,
database :process.env.MYSQL_DB
2021-12-31 09:33:23 +00:00
});
connection.connect(function(error){
if(error)
{
console.log(error);
}
else
{
console.log("Database Connected...");
}
});
module.exports = connection;