VIBN Frontend for Coolify deployment

This commit is contained in:
2026-02-15 19:25:52 -08:00
commit 40bf8428cd
398 changed files with 76513 additions and 0 deletions

26
lib/db.ts Normal file
View File

@@ -0,0 +1,26 @@
import { Pool } from 'pg';
// Use the same database URL from the Extension proxy
const DATABASE_URL = process.env.DATABASE_URL ||
'postgresql://postgres:jhsRNOIyjjVfrdvDXnUVcXXXsuzjvcFc@metro.proxy.rlwy.net:30866/railway';
let pool: Pool | null = null;
export function getPool() {
if (!pool) {
pool = new Pool({
connectionString: DATABASE_URL,
ssl: {
rejectUnauthorized: false,
},
});
}
return pool;
}
export async function query<T = any>(text: string, params?: any[]): Promise<T[]> {
const pool = getPool();
const result = await pool.query(text, params);
return result.rows;
}