From 46c96bc2e9b9288d7538949dadce9e5ae6997d28 Mon Sep 17 00:00:00 2001 From: Redume Date: Wed, 14 Feb 2024 15:11:12 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=BF=D0=BE=D0=B4=D1=85=D0=B2=D0=B0=D1=82=20=D0=B4?= =?UTF-8?q?=D0=B0=D0=BD=D0=BD=D1=8B=D1=85=20=D0=B8=D0=B7=20=D0=BA=D0=BE?= =?UTF-8?q?=D0=BD=D1=84=D0=B8=D0=B3=D0=B0=20=D0=B4=D0=BB=D1=8F=20=D1=83?= =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D1=81=D1=82=D0=B2=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- postgresql.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) 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;