You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
357 B
JavaScript

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;