File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed
samples/nextjs-postgres/app/src/app Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -9,10 +9,12 @@ const client = new Client({
99 database : process . env . POSTGRES_DB ,
1010 password : process . env . POSTGRES_PASSWORD ,
1111 port : parseInt ( process . env . POSTGRES_PORT ! , 10 ) ,
12+ // We have to connect with SSL when we deploy, but we want to allow self-signed certificates
1213 ssl : process . env . POSTGRES_SSL === 'true' ? { rejectUnauthorized : false } : false ,
1314} ) ;
1415
1516// Only connect if we actually have the password
17+ // This prevents a connection error during build time (since we don't have access to the DB during build)
1618const connection = process . env . POSTGRES_PASSWORD ? client . connect ( ) : Promise . resolve ( ) ;
1719
1820function parseIPv6MappedIPv4 ( ip : string | null ) {
You can’t perform that action at this time.
0 commit comments