Answers for "typeormmodule unable to connect to the database postgres heroku"

0

typeormmodule unable to connect to the database postgres heroku

add this props to your cnf object:

ssl: true,
extra: {
  ssl: {
    rejectUnauthorized: false,
  },
},

//
const cfg: TypeOrmModuleOptions = {
---> Add here!!! <---
  type: 'postgres',
  host: process.env.DB_HOST,
  database: process.env.DB_NAME,
  username: process.env.DB_USER,
  password: process.env.DB_PASSWORD,
  port: Number(process.env.DB_PORT),
};

@Module({
  imports: [TypeOrmModule.forRoot(cfg)],
})
export class AppModule {}
Posted by: Guest on September-14-2021

Code answers related to "typeormmodule unable to connect to the database postgres heroku"

Browse Popular Code Answers by Language