From 653e35baee991fe999e9a71879af42b551ed55b0 Mon Sep 17 00:00:00 2001 From: Randall Stillwell Date: Tue, 22 Jul 2025 06:53:36 -0500 Subject: [PATCH] Add comprehensive debug endpoint to check environment variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit �� Debug Information: - New /api/debug endpoint with detailed environment info - Check for DATABASE_URL and JWT_SECRET presence - Show environment variable keys related to database - Force fresh deployment with new endpoint name This will help identify if environment variables are properly configured in Vercel. --- api/debug.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 api/debug.js diff --git a/api/debug.js b/api/debug.js new file mode 100644 index 0000000..1893550 --- /dev/null +++ b/api/debug.js @@ -0,0 +1,18 @@ +export default function handler(req, res) { + res.status(200).json({ + success: true, + message: 'Debug endpoint - latest version', + timestamp: new Date().toISOString(), + method: req.method, + environment: process.env.NODE_ENV || 'unknown', + vercel_env: process.env.VERCEL_ENV || 'unknown', + has_database_url: !!process.env.DATABASE_URL, + has_jwt_secret: !!process.env.JWT_SECRET, + database_url_length: process.env.DATABASE_URL ? process.env.DATABASE_URL.length : 0, + database_url_starts_with: process.env.DATABASE_URL ? + process.env.DATABASE_URL.substring(0, 20) + '...' : 'not set', + all_env_keys: Object.keys(process.env).filter(key => + key.includes('DATABASE') || key.includes('JWT') || key.includes('NEON') + ) + }); +} \ No newline at end of file