From 84a0c0502f083a102589d6b284c1fa8b26c53e8a Mon Sep 17 00:00:00 2001 From: Redume Date: Thu, 15 Feb 2024 10:51:09 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BE=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BE=D0=BD=D1=84=D0=B8=D0=B3=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config_sample.yaml | 18 +++++++++++++----- postgresql.js | 10 +++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/config_sample.yaml b/config_sample.yaml index 65ca1bc..c78fec3 100644 --- a/config_sample.yaml +++ b/config_sample.yaml @@ -1,5 +1,13 @@ -db_user: "DATABASE_USERNAME" -db_password: "DATABASE_PASSWORD" -db_host: "DATABASE_HOST" -db_name: "DATABASE_NAME" -db_port: 5432 +db: + user: "DATABASE_USERNAME" + password: "DATABASE_PASSWORD" + host: "DATABASE_HOST" + name: "DATABASE_NAME" + port: 5432 +currency: + - USD + - RUB + - EUR + - UAH + - TRY + - KZT \ No newline at end of file diff --git a/postgresql.js b/postgresql.js index ee3924f..4c80eb0 100644 --- a/postgresql.js +++ b/postgresql.js @@ -4,11 +4,11 @@ const fs = require("fs"); const config = yaml.parse(fs.readFileSync("./config.yaml", "utf-8")); const pool = new pg.Pool({ - user: config['db_user'], - password: config['db_password'], - host: config['db_host'], - port: config['db_port'], - database: config['db_name'] + user: config['db']['user'], + password: config['db']['password'], + host: config['db']['host'], + port: config['db']['port'], + database: config['db']['name'] }); module.exports = pool;