Skip to content

Instantly share code, notes, and snippets.

@hdon
Created March 6, 2017 20:33
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 hdon/d61cf152a9cc1a1f7121ba0d1baf24a5 to your computer and use it in GitHub Desktop.
Save hdon/d61cf152a9cc1a1f7121ba0d1baf24a5 to your computer and use it in GitHub Desktop.
Connecting to MySQL with Knex
{
"host": "xxxxxxxxxx"
, "user": "xxxxxxxxxx"
, "password": "xxxxxxxxxxxxxxxxxxxx"
, "database": "xxxxxxxxxxxxxxxxx"
}
let knex = require('knex')({
client: 'mysql'
, connection: JSON.parse(fs.readFileSync('database.json'))
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment