parent
7587bf3040
commit
8ac2763dff
@ -1,7 +1,16 @@
|
||||
const Client = require('pg').Client
|
||||
|
||||
const client = new Client({
|
||||
connectionString: process.env.DATABASE_URL || 'postgresql://localhost:5432/contacts',
|
||||
})
|
||||
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;
|
||||
|
||||
Loading…
Reference in new issue