How do you connect to a Postgres Database with no password using pg-promise?

Viewed 3734

I am trying to initialize a connection to my PG database doing this:

    pgp = require('pg-promise')({
    // Initialization Options
}),
cn = {
    host: 'activity.postgres.activity', // server name or IP address;
    port: 5432,
    database: 'activity',
    user: 'postgres',
    password: ''
},
db = pgp(cn),

But I keep getting:

Error: connect ECONNREFUSED 172.20.0.3:5432

Any idea why?

RESOLVED: set the listen_addresses = '*' in the postgresql.conf file

2 Answers
Related