mirror of
https://github.com/Redume/Kekkai.git
synced 2025-02-23 12:43:12 +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 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({
|
const pool = new pg.Pool({
|
||||||
user: "",
|
user: config['db_user'],
|
||||||
password: "",
|
password: config['db_password'],
|
||||||
host: "",
|
host: config['db_host'],
|
||||||
port: 5432,
|
port: config['db_port'],
|
||||||
database: ""
|
database: config['db_name']
|
||||||
})
|
});
|
||||||
|
|
||||||
|
module.exports = pool;
|
||||||
|
|
Loading…
Add table
Reference in a new issue