From affd70b9a7ac457e9ffe89db113e2571cb6ccc1d Mon Sep 17 00:00:00 2001 From: Mannu Date: Sun, 10 May 2026 04:55:31 +0530 Subject: [PATCH] fix: debug route --- src/app/api/debug/route.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/app/api/debug/route.ts b/src/app/api/debug/route.ts index b780c33..b6f08c2 100644 --- a/src/app/api/debug/route.ts +++ b/src/app/api/debug/route.ts @@ -4,22 +4,15 @@ export async function GET() { const results: Record = {}; try { - // Test without using DATABASE_URL directly - const { default: postgres } = await import("postgres"); - const connectionString = process.env.DATABASE_URL || ""; results["env_exists"] = connectionString ? "yes" : "no"; - results["env_value"] = connectionString; - // Try connection if (connectionString) { + const { default: postgres } = await import("postgres"); const client = postgres(connectionString); - await client.connect(); - results["connect"] = "success"; - const result = await client`SELECT version()`; + results["connect"] = "success"; results["version"] = result[0]?.version?.slice(0, 50) || "ok"; - await client.end(); } } catch (err: any) {