2019-08-15 14:41:02 -04:00
|
|
|
const { Client } = require('pg');
|
2019-08-15 09:23:28 -04:00
|
|
|
|
|
|
|
|
const pgclient = new Client({
|
2019-08-15 14:41:02 -04:00
|
|
|
host: process.env.POSTGRES_HOST,
|
|
|
|
|
port: process.env.POSTGRES_PORT,
|
2019-08-15 09:23:28 -04:00
|
|
|
user: 'postgres',
|
|
|
|
|
password: 'postgres',
|
|
|
|
|
database: 'postgres'
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
pgclient.connect();
|
|
|
|
|
|
|
|
|
|
pgclient.query('SELECT NOW()', (err, res) => {
|
|
|
|
|
if (err) throw err
|
|
|
|
|
console.log(res)
|
|
|
|
|
pgclient.end()
|
|
|
|
|
});
|