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
355 B
JavaScript
18 lines
355 B
JavaScript
const { Pool } = require('pg');
|
|
const debug = require('debug')('sos:pg');
|
|
|
|
const pool = new Pool({
|
|
max: 20,
|
|
host: process.env.DB_HOST,
|
|
user: process.env.DB_USER,
|
|
database: process.env.DB_NAME,
|
|
password: process.env.DB_PASS,
|
|
connectionTimeoutMillis: 200
|
|
});
|
|
|
|
pool.on('error', err=>debug(err));
|
|
|
|
debug("Database ready");
|
|
|
|
module.exports = pool;
|