chore(storm-forecast): temp debug probe for env key presence
This commit is contained in:
@@ -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');
|
||||||
|
|||||||
Reference in New Issue
Block a user