You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

17 lines
315 B

const Client = require('pg').Client
const dbConfig = {
connectionString: 'postgresql://localhost:5432/contacts',
}
if(process.env.DATABASE_URL){
dbConfig.ssl = { rejectUnauthorized: false }
dbConfig.connectionString = process.env.DATABASE_URL
}
const client = new Client(dbConfig)
module.exports = client;