MCPcopy Index your code
hub / github.com/serverless/examples / createConn

Function createConn

aws-node-heroku-postgres/handler.js:26–40  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24const app = express();
25
26const createConn = async () => {
27 console.log('Creating PG connection.');
28
29 const credsResponse = await herokuClient.get(`addons/${herokuPostgresId}/config`);
30 const pgConnStr = credsResponse.data[0]['value'];
31
32 pgConfig = {
33 ...parsePgConnStr(pgConnStr), ...{
34 max: 1,
35 ssl: true,
36 },
37 };
38
39 pgPool = new pg.Pool(pgConfig);
40};
41
42const performQuery = async () => {
43 const client = await pgPool.connect();

Callers 1

handler.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected