Skip to content

Commit

Permalink
fix: add ssl default config
Browse files Browse the repository at this point in the history
  • Loading branch information
diervo committed Oct 15, 2020
1 parent 0cce20c commit c9b339a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/@best/api-db/src/sql/postgres/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,17 @@ import { SQLDatabase, SQLQueryResult } from '../db'
import { ApiDatabaseConfig } from '@best/types';
import { migrate } from './migrate';

const PGSSLMODE = process.env.PGSSLMODE;

export default class PostgresDatabase extends SQLDatabase {
pool: Pool
migrated = false;

constructor(config: ApiDatabaseConfig) {
super()
super();
this.pool = new Pool({
connectionString: config.uri,
ssl: config.ssl
ssl: config.ssl || PGSSLMODE ? { rejectUnauthorized: false } : false
})
}

Expand Down

0 comments on commit c9b339a

Please sign in to comment.