I am using Digitalocean managed PostgreSQL and trying to access the database from node.js (using pg-promise) which is a Google Cloud Function.
no pg_hba.conf entry for host "IP-ADDRESS", user "username", database "database", SSL off
Below is my db config
import * as pgPromise from 'pg-promise';
const dbConfig = {
username: 'username',
password: 'password',
host: 'host string',
port: PORTNUMBER,
database: 'database',
sslmode: 'require'
};
const pgp = pgPromise({});
const db = pgp(dbConfig);
export { db, pgp };
How to fix this? Please advise.