Remove test files and commit necessary changes
This commit is contained in:
19
lib/db.ts
Normal file
19
lib/db.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import { config } from 'dotenv';
|
||||
config({ path: '.env.local' });
|
||||
|
||||
import { Pool } from 'pg';
|
||||
|
||||
console.log('process.env:', process.env);
|
||||
const connectionString = process.env.DATABASE_URL;
|
||||
|
||||
console.log('DATABASE_URL in lib/db.ts:', connectionString);
|
||||
|
||||
if (!connectionString) {
|
||||
throw new Error('DATABASE_URL is not set in environment variables');
|
||||
}
|
||||
|
||||
const pool = new Pool({
|
||||
connectionString,
|
||||
});
|
||||
|
||||
export default pool;
|
||||
Reference in New Issue
Block a user