From 13f0f8d3cf30cb33a87b570da5a55e7268867fd9 Mon Sep 17 00:00:00 2001 From: Satyam Rastogi Date: Sat, 30 May 2026 05:45:37 +0530 Subject: [PATCH] chore(storm-forecast): temp debug probe for env key presence --- api/storm-forecast.js | 11 +++++++++++ 1 file changed, 11 insertions(+) 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');