diff --git a/postgresql.js b/postgresql.js index 6c8443e..ee3924f 100644 --- a/postgresql.js +++ b/postgresql.js @@ -1,8 +1,14 @@ const pg = require("pg"); +const yaml = require("yaml") +const fs = require("fs"); +const config = yaml.parse(fs.readFileSync("./config.yaml", "utf-8")); + const pool = new pg.Pool({ - user: "", - password: "", - host: "", - port: 5432, - database: "" -}) + user: config['db_user'], + password: config['db_password'], + host: config['db_host'], + port: config['db_port'], + database: config['db_name'] +}); + +module.exports = pool;