mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-11 17:29:48 +02:00
Enable SSL for production database connections and replace CameraModal component. Replit-Commit-Author: Agent Replit-Commit-Session-Id: dba29e89-b855-4de3-a5a0-765e63b7aa34
16 lines
468 B
TypeScript
16 lines
468 B
TypeScript
import { Pool } from 'pg';
|
|
import { drizzle } from 'drizzle-orm/node-postgres';
|
|
import * as schema from "@shared/schema";
|
|
|
|
if (!process.env.DATABASE_URL) {
|
|
throw new Error(
|
|
"DATABASE_URL must be set. Did you forget to provision a database?",
|
|
);
|
|
}
|
|
|
|
export const pool = new Pool({
|
|
connectionString: process.env.DATABASE_URL,
|
|
ssl: process.env.NODE_ENV === 'production' ? { rejectUnauthorized: false } : false
|
|
});
|
|
|
|
export const db = drizzle(pool, { schema }); |