Skip to content

Instantly share code, notes, and snippets.

@jonathanfrancisco
Last active June 24, 2018 09:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonathanfrancisco/f9f9e56e10ae870dcce2523d47bee2e1 to your computer and use it in GitHub Desktop.
Save jonathanfrancisco/f9f9e56e10ae870dcce2523d47bee2e1 to your computer and use it in GitHub Desktop.
Returns a promised connect() method without calling createConnection() everytime
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