how to connect next js with postgresql localhost

Solutions on MaxInterview for how to connect next js with postgresql localhost by the best coders in the world

showing results for - "how to connect next js with postgresql localhost"
Cristina
16 Feb 2020
1const pgp = require('pg-promise')();
2
3// Get the values for these variables from configuration
4const user = ...
5const password = ...
6const host = ...
7const port = ...
8const database = ...
9
10const db = pgp(`postgres://${user}:${password}@${host}:${port}/${database}`)