Backend/lib/db.js

22 lines
417 B
JavaScript
Raw Permalink Normal View History

2021-12-31 09:33:23 +00:00
var mysql = require('mysql');
2022-01-20 14:19:05 +00:00
2021-12-31 09:33:23 +00:00
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...");
}
});
2022-01-20 14:19:05 +00:00
module.exports = connection;