deploy: notesfrais — 2026-04-29 09:57:19

This commit is contained in:
deploy
2026-04-29 09:57:19 +02:00
commit abbc9b16e1
56 changed files with 6872 additions and 0 deletions
+18
View File
@@ -0,0 +1,18 @@
import { Pool } from 'pg';
import { config } from './config';
export const db = new Pool({
connectionString: config.databaseUrl,
ssl: config.nodeEnv === 'production' ? { rejectUnauthorized: false } : false,
max: 10,
});
db.on('error', (err) => {
console.error('Erreur pool PostgreSQL :', err.message);
});
export async function testConnection(): Promise<void> {
const client = await db.connect();
client.release();
console.log('✅ PostgreSQL connecté');
}