Advertisement
Guest User

Untitled

a guest
Apr 27th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var mysql = require('mysql');
  2. var config = require('./config');
  3.  
  4. var options = {
  5.     user: config.get('MYSQL_USER'),
  6.     password: config.get('MYSQL_PASSWORD'),
  7.     database: 'booking'
  8. };
  9.  
  10. /*
  11. if (config.get('INSTANCE_CONNECTION_NAME') && config.get('NODE_ENV') === 'production') {
  12.     options.socketPath = 'cloudsql/' + config.get('INSTANCE_CONNECTION_NAME');
  13. }*/
  14.  
  15.  
  16. var connection = mysql.createConnection(options);
  17.  
  18. module.exports = connection;
  19. exports.connection = connection;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement