mirror of
https://github.com/cheveguerra/bot-whatsapp.git
synced 2026-04-18 03:29:15 +00:00
18 lines
528 B
JavaScript
18 lines
528 B
JavaScript
const mysql = require('mysql');
|
|
const connection = mysql.createConnection({
|
|
host : process.env.SQL_HOST || 'localhost',
|
|
user : process.env.SQL_USER || 'me',
|
|
password : process.env.SQL_PASS || '',
|
|
database : process.env.SQL_DATABASE || 'my_db'
|
|
});
|
|
|
|
const connect = () => connection.connect(function(err) {
|
|
if (err) {
|
|
console.error('error connecting: ' + err.stack);
|
|
return;
|
|
}
|
|
|
|
console.log('Conexion correcta con tu base de datos MySQL')
|
|
});
|
|
|
|
module.exports = {connect, connection} |