Guest User

Untitled

a guest
Apr 18th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. module.exports = {
  2. host: "localhost",
  3. user: "root",
  4. password: --------,
  5. database: "addresses",
  6. port: 1337
  7. }
  8.  
  9. var config = require('./exports');
  10. var mysql = require('mysql');
  11. var db = mysql.createConnection({
  12. host: config.host,
  13. user: config.user,
  14. password: config.password,
  15. database: config.database,
  16. port: config.port
  17. });
  18.  
  19. db.connect(function(err) {
  20. if (err) throw err;
  21. console.log("Connected!");
  22. });
  23. module.exports = {db};
Add Comment
Please, Sign In to add comment