Skip to content

Commit f93585a

Browse files
committed
some documentation
1 parent 1525a5c commit f93585a

File tree

1 file changed

+2
-0
lines changed
  • samples/nextjs-postgres/app/src/app

1 file changed

+2
-0
lines changed

samples/nextjs-postgres/app/src/app/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff 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)
1618
const connection = process.env.POSTGRES_PASSWORD ? client.connect() : Promise.resolve();
1719

1820
function parseIPv6MappedIPv4(ip: string | null) {

0 commit comments

Comments
 (0)