Parameterize configuration

This commit is contained in:
Quentin 2020-05-19 19:21:09 +02:00
parent 6d1c65fd10
commit 811f3fff25

View file

@ -1,10 +1,10 @@
const { Pool } = require('pg') const { Pool } = require('pg')
const pool = new Pool({ const pool = new Pool({
user: 'admin', user: process.env.user || 'admin',
host: '127.0.0.1', host: process.env.host || '127.0.0.1',
database: 'platoo', database: process.env.database || 'platoo',
password: 'm1y2s3q4l5', password: process.env.password,
port: 5432, port: process.env.port || 5432,
}) })
module.exports = { module.exports = {
query: (text, params, callback) => { query: (text, params, callback) => {