1var mysql = require('mysql');
2
3var connection = mysql.createConnection({
4 host : process.env.RDS_HOSTNAME,
5 user : process.env.RDS_USERNAME,
6 password : process.env.RDS_PASSWORD,
7 port : process.env.RDS_PORT
8});
9
10connection.connect(function(err) {
11 if (err) {
12 console.error('Database connection failed: ' + err.stack);
13 return;
14 }
15
16 console.log('Connected to database.');
17});
18
19connection.end();