Add database integration, auth API, admin/user portals, and deploy-db.sh
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { Pool } from 'pg';
|
||||
|
||||
const connectionString = process.env.DATABASE_URL;
|
||||
|
||||
if (!connectionString) {
|
||||
throw new Error('DATABASE_URL environment variable is not set');
|
||||
}
|
||||
|
||||
export const db = new Pool({ connectionString });
|
||||
|
||||
export async function query(text: string, params?: unknown[]) {
|
||||
const result = await db.query(text, params);
|
||||
return result;
|
||||
}
|
||||
Reference in New Issue
Block a user