DEV Community

Thiago
Thiago

Posted on

no pg_hba.conf entry for host heroku

After searching a lot on internet about this problem, finally I found a solution on documentation:

Create a ./config/env/production/database.js file containing the following code:

const { parse } = require("pg-connection-string");

module.exports = ({ env }) => {
const { host, port, database, user, password } = parse(env("DATABASE_URL"));

return {
defaultConnection: "default",
connections: {
default: {
connector: "bookshelf",
settings: {
client: "postgres",
host,
port,
database,
username: user,
password,
ssl: { rejectUnauthorized: false }
},
options: {
ssl: false
},
},
},
};
};

doc: https://strapi.io/blog/deploying-a-strapi-api-on-heroku

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more