-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
46 lines (32 loc) · 1.04 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
const express = require('express');
const { Pool } = require("pg")
let app = express();
const dotenv = require("dotenv");
// dotenv.config({ path: "./config.env" });
dotenv.config();
// const pool = new Pool({
// USERNAME: process.env.USERNAME,
// HOST: process.env.HOST,
// DATABASE: process.env.DATABASE,
// PASSWORD: process.env.PASSWORD,
// PORT: process.env.PORT,
// ssl: process.env.SSL,
// });
const connectionString = 'postgresql://kimicodes:lKMnOqQN7m46GGVb3TDmyKamDjyP49D7@dpg-cspm6mij1k6c73b04mtg-a/codejeopostgres_l8pp'
//external
// const connectionString = "postgresql://kimicodes:lKMnOqQN7m46GGVb3TDmyKamDjyP49D7@dpg-cspm6mij1k6c73b04mtg-a.oregon-postgres.render.com/codejeopostgres_l8pp"
// const pool = new Pool({
// connectionString,
// })
// pool.query('SELECT NOW()')
// pool.end()
// const client = new Client({
// connectionString,
// })
// client.connect()
// // client.query('SELECT NOW()')
// // client.end()
// module.exports = pool;
module.exports = {
query: (text, params) => pool.query(text, params)
};