More dependencies split from app.js. Home screen buttons are currently not working

This commit is contained in:
2024-05-28 00:49:06 -05:00
parent 30156d5af2
commit b2ec54daf8
7 changed files with 108 additions and 59 deletions

24
src/database/db.js Normal file
View File

@@ -0,0 +1,24 @@
const pgp = require("pg-promise")();
// Database configuration
const dbConfig = {
host: "db",
port: 5432,
database: "users_db",
user: "postgres",
password: "pwd",
};
const db = pgp(dbConfig);
// Test database connection
db.connect()
.then((obj) => {
console.log("Database connection successful");
obj.done();
})
.catch((error) => {
console.log("ERROR:", error.message || error);
});
module.exports = db;