mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-11 17:29:48 +02:00
Integrates user authentication using bcrypt, session management with PostgreSQL, and role-based access control for enhanced security and user management. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 91318273-c764-4fd4-be04-bdc12c38af32 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/ab880d72-1a34-4d36-b5be-9f44df85ed1a.jpg
15 lines
482 B
TypeScript
15 lines
482 B
TypeScript
import { Pool, neonConfig } from '@neondatabase/serverless';
|
|
import { drizzle } from 'drizzle-orm/neon-serverless';
|
|
import ws from "ws";
|
|
import * as schema from "@shared/schema";
|
|
|
|
neonConfig.webSocketConstructor = ws;
|
|
|
|
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 });
|
|
export const db = drizzle({ client: pool, schema }); |