diff --git a/gofr-backend/lib/gofr-backend-site/config/default.json.example b/gofr-backend/lib/gofr-backend-site/config/default.json.example index 0289d9df..0f21784f 100644 --- a/gofr-backend/lib/gofr-backend-site/config/default.json.example +++ b/gofr-backend/lib/gofr-backend-site/config/default.json.example @@ -17,6 +17,13 @@ "path": "/var/lib/gofr/gofr-backend/lib" } }, + "database": { + "dbname": "hapi", + "username": "hapi", + "password": "hapi", + "host": "localhost", + "port": 5432 + }, "server": { "hostname": "0.0.0.0", "port": 4000 diff --git a/gofr-backend/lib/modules/postgres.js b/gofr-backend/lib/modules/postgres.js index aa3c5425..ce41701c 100644 --- a/gofr-backend/lib/modules/postgres.js +++ b/gofr-backend/lib/modules/postgres.js @@ -1,10 +1,11 @@ const { Pool, escapeLiteral } = require("pg"); +const config = require('../config'); const pool = new Pool({ - database: "gofr", - user: "hapi", - password: "hapi", - port: 5432, - host: "localhost", + database: config.get('database:dbname'), + user: config.get('database:username'), + password: config.get('database:password'), + port: config.get('database:port'), + host: config.get('database:host') }); module.exports = { pool, escapeLiteral }; \ No newline at end of file