Made some modifications to NeahFront9 project mac 2
This commit is contained in:
parent
5099a475c7
commit
115c38b94a
@ -2,20 +2,13 @@ import { NextResponse } from 'next/server';
|
||||
import { Pool } from 'pg';
|
||||
|
||||
// Get database configuration from environment variables
|
||||
const DB_HOST = process.env.DB_HOST || 'cube.governance-labs.com';
|
||||
const DB_HOST = process.env.DB_HOST || '172.16.0.104';
|
||||
const DB_PORT = process.env.DB_PORT || '5432';
|
||||
const DB_USER = process.env.DB_USER || 'alma';
|
||||
const DB_PASSWORD = process.env.DB_PASSWORD;
|
||||
const DB_NAME = process.env.DB_NAME || 'rivacube';
|
||||
|
||||
// Validate required environment variables
|
||||
if (!DB_PASSWORD) {
|
||||
console.error('DB_PASSWORD environment variable is not set');
|
||||
throw new Error('Database password is not configured');
|
||||
}
|
||||
|
||||
// Construct connection string from components
|
||||
const connectionString = `postgresql://${DB_USER}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}`;
|
||||
const connectionString = `postgresql://${DB_USER}@${DB_HOST}:${DB_PORT}/${DB_NAME}`;
|
||||
|
||||
// Log the connection string (with password masked for security)
|
||||
const maskedConnectionString = connectionString.replace(/\/\/[^:]+:[^@]+@/, '//***:***@');
|
||||
@ -23,7 +16,6 @@ console.log('Using connection string:', maskedConnectionString);
|
||||
|
||||
const pool = new Pool({
|
||||
connectionString,
|
||||
// Remove SSL configuration since the server doesn't support it
|
||||
// Add connection timeout
|
||||
connectionTimeoutMillis: 5000,
|
||||
// Add query timeout
|
||||
|
||||
Loading…
Reference in New Issue
Block a user