Kekkai/postgresql.js

15 lines
379 B
JavaScript
Raw Normal View History

2024-02-13 23:02:10 +03:00
const pg = require("pg");
const yaml = require("yaml")
const fs = require("fs");
const config = yaml.parse(fs.readFileSync("./config.yaml", "utf-8"));
2024-02-13 23:02:10 +03:00
const pool = new pg.Pool({
2024-02-15 10:51:09 +03:00
user: config['db']['user'],
password: config['db']['password'],
host: config['db']['host'],
port: config['db']['port'],
database: config['db']['name']
});
module.exports = pool;