Add comprehensive debug endpoint to check environment variables
�� 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.
This commit is contained in:
parent
a8abe0130f
commit
653e35baee
1 changed files with 18 additions and 0 deletions
18
api/debug.js
Normal file
18
api/debug.js
Normal file
|
|
@ -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')
|
||||||
|
)
|
||||||
|
});
|
||||||
|
}
|
||||||
Loading…
Reference in a new issue