This commit is contained in:
+6
-6
@@ -5,14 +5,14 @@ import path from 'path'
|
||||
const migrate = require('node-pg-migrate')
|
||||
|
||||
// Database connection configuration
|
||||
const { DB_USERNAME, DB_HOST, DB_DATABASE, DB_PASSWORD, DB_PORT } = process.env;
|
||||
const { DB_USERNAME, DB_HOST, DB_DATABASE, DB_PASSWORD, DB_PORT } = process.env
|
||||
|
||||
const dbConfig = {
|
||||
user: DB_USERNAME || 'your_user', // Use the environment variable if it exists, otherwise use 'your_user'
|
||||
host: DB_HOST || 'localhost',
|
||||
database: DB_DATABASE || 'your_database',
|
||||
password: DB_PASSWORD || 'your_password',
|
||||
port: parseInt(DB_PORT, 10) || 5432, // Convert the environment variable to a number if it exists, otherwise use 5432
|
||||
user: DB_USERNAME || 'your_user', // Use the environment variable if it exists, otherwise use 'your_user'
|
||||
host: DB_HOST || 'localhost',
|
||||
database: DB_DATABASE || 'your_database',
|
||||
password: DB_PASSWORD || 'your_password',
|
||||
port: parseInt(DB_PORT, 10) || 5432, // Convert the environment variable to a number if it exists, otherwise use 5432
|
||||
}
|
||||
|
||||
const pool = new Pool(dbConfig)
|
||||
|
||||
Reference in New Issue
Block a user