Last active
August 30, 2019 07:20
-
-
Save sobinsunny/a618e524bd6affe1bd5f4f34d9a316d4 to your computer and use it in GitHub Desktop.
code for Knex connection establish with postgres.
This file contains hidden or 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
const pg = require('pg'); | |
const knexConfig = { | |
client: 'pg', | |
connection: { | |
host : process.env.SQL_HOST, | |
database: process.env.SQL_DB, | |
user: process.env.SQL_USERNAME, | |
password: process.env.SQL_PASSWORD, | |
} | |
}; | |
module.exports = require('knex')(knexConfig); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment