From 8eb5de257114be7bc99dcc80e6b575b277e1d2e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20St=C3=B8rdal?= <30749741+hakon55@users.noreply.github.com> Date: Wed, 3 Sep 2025 00:45:53 +0200 Subject: [PATCH] Legger med env --- src/lib/db.ts | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/lib/db.ts b/src/lib/db.ts index 8721460..0453cf0 100644 --- a/src/lib/db.ts +++ b/src/lib/db.ts @@ -1,22 +1,15 @@ import { Pool } from 'pg'; -import { env } from '$env/dynamic/private'; // Get DATABASE_URL with fallback -const getDatabaseUrl = () => { - return ( - env.DATABASE_URL || - process.env.DATABASE_URL || - 'postgresql://postgres:password@localhost:5432/egentrening' - ); -}; - +const getDatabaseUrl = + 'postgres://postgres:voHMlrqwwzlZcqWW3oCYvkmWnmOAFntc4nYJmTRVsr7bm8CiOoxqAKv1zVn5Opsq@192.168.0.133:5432/postgres'; // Lazy pool creation - only create when actually needed let pool: Pool | null = null; const getPool = () => { if (!pool) { pool = new Pool({ - connectionString: getDatabaseUrl(), + connectionString: getDatabaseUrl, ssl: false }); }