Guest User

Untitled

a guest
Dec 15th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. var mysql = require('mysql');
  2. port = process.env.PORT || 4205;
  3.  
  4. if (port === 4205) {
  5.  
  6. var connection = mysql.createConnection({
  7. host: 'localhost',
  8. port: 3306,
  9. user: 'root',
  10. password: '',
  11. database: 'your_api',
  12. insecureAuth: true
  13. });
  14. } else {
  15.  
  16. //same as above, with live server details
  17. }
  18.  
  19. connection.connect();
  20.  
  21. module.exports = connection;
Add Comment
Please, Sign In to add comment