Last active
June 24, 2018 09:12
-
-
Save jonathanfrancisco/f9f9e56e10ae870dcce2523d47bee2e1 to your computer and use it in GitHub Desktop.
Returns a promised connect() method without calling createConnection() everytime
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = () => { | |
return mysql.createConnection({ | |
host: config.dbHost, | |
user: config.dbUsername, | |
password: config.dbPassword, | |
database: config.dbName | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment