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)