const { Pool } = require('pg'); const debug = require('debug')('sos:pg'); const pool = new Pool({ max: 40, connectionTimeoutMillis: 1000, host: process.env.DB_HOST, user: process.env.DB_USER, database: process.env.DB_NAME, password: process.env.DB_PASS, }); pool.on('error', err=>debug(err)); debug("Database ready"); module.exports = pool;