File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -89,7 +89,6 @@ const startWorker = (workerId) => {
8989 host : process . env . DB_HOST || pg . defaults . host ,
9090 port : process . env . DB_PORT || pg . defaults . port ,
9191 max : 10 ,
92- ssl : ! ! process . env . DB_SSLMODE && process . env . DB_SSLMODE !== 'disable' ? true : undefined ,
9392 } ,
9493
9594 production : {
@@ -99,11 +98,15 @@ const startWorker = (workerId) => {
9998 host : process . env . DB_HOST || 'localhost' ,
10099 port : process . env . DB_PORT || 5432 ,
101100 max : 10 ,
102- ssl : ! ! process . env . DB_SSLMODE && process . env . DB_SSLMODE !== 'disable' ? true : undefined ,
103101 } ,
104102 } ;
105103
106- const app = express ( ) ;
104+ if ( ! ! process . env . DB_SSLMODE && process . env . DB_SSLMODE !== 'disable' ) {
105+ pgConfigs . development . ssl = true ;
106+ pgConfigs . production . ssl = true ;
107+ }
108+
109+ const app = express ( ) ;
107110 app . set ( 'trusted proxy' , process . env . TRUSTED_PROXY_IP || 'loopback,uniquelocal' ) ;
108111
109112 const pgPool = new pg . Pool ( Object . assign ( pgConfigs [ env ] , dbUrlToConfig ( process . env . DATABASE_URL ) ) ) ;
You can’t perform that action at this time.
0 commit comments