diff --git a/api/storm-forecast.js b/api/storm-forecast.js index d7dbb19..97e4722 100644 --- a/api/storm-forecast.js +++ b/api/storm-forecast.js @@ -46,6 +46,17 @@ export default async function handler(req, res) { 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; if (!key) { console.warn('[storm-forecast] TOMORROW_API_KEY not set');