mirror of
https://github.com/Redume/Kekkai.git
synced 2025-02-23 20:51:25 +03:00
добавлен подхват данных из конфига для удобства
This commit is contained in:
parent
91686cd628
commit
46c96bc2e9
1 changed files with 12 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue