chore(storm-forecast): temp debug probe for env key presence

This commit is contained in:
Satyam Rastogi
2026-05-30 05:45:37 +05:30
parent 741a999b39
commit 13f0f8d3cf
+11
View File
@@ -46,6 +46,17 @@ export default async function handler(req, res) {
return res.status(405).json({ error: 'Method not allowed' }); return res.status(405).json({ error: 'Method not allowed' });
} }
// TEMP DIAGNOSTIC — remove after debugging. Reports key presence (never the value).
if (req.query && req.query.debug === '1') {
const k = process.env.TOMORROW_API_KEY || '';
return res.status(200).json({
hasKey: k.length > 0,
keyLength: k.length,
expectedLength: 32,
node: process.version,
});
}
const key = process.env.TOMORROW_API_KEY; const key = process.env.TOMORROW_API_KEY;
if (!key) { if (!key) {
console.warn('[storm-forecast] TOMORROW_API_KEY not set'); console.warn('[storm-forecast] TOMORROW_API_KEY not set');