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.
17 lines
323 B
JavaScript
17 lines
323 B
JavaScript
5 years ago
|
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
|
||
|
});
|
||
|
|
||
|
pool.on('error', err=>debug(err));
|
||
|
|
||
|
debug("Database ready");
|
||
|
|
||
|
module.exports = pool;
|