Last active
April 17, 2019 08:06
-
-
Save tamunoibi/d5d68807e6c0ed526642660780819c08 to your computer and use it in GitHub Desktop.
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
| import { Pool } from 'pg'; | |
| import dotenv from 'dotenv'; | |
| dotenv.config(); | |
| // const config = { | |
| // development: process.env.DEVELOPMENT_URL, | |
| // test: process.env.TEST_URL, | |
| // production: process.env.PRODUCTION_URL, | |
| // }; | |
| // const env = process.env.NODE_ENV; | |
| // const pool = new Pool({ | |
| // connectionString: config[env], | |
| // }); | |
| // const connect = process.env.TESTSTRING; | |
| const connect = process.env.DEVELOPSTRING; | |
| const pool = new Pool({ | |
| connectionString: connect, | |
| }); | |
| pool.on('connect', () => { | |
| console.log('connected to the db'); | |
| }); | |
| export default pool; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment