Replacing entire backend messages (especially logs) with English instead of Germany
This commit is contained in:
@@ -45,7 +45,7 @@ router.get('/', async (req, res) => {
|
||||
const currentUrl = `https://api.openweathermap.org/data/2.5/weather?q=${encodeURIComponent(city)}&appid=${apiKey}&units=${units}&lang=${lang}`;
|
||||
const currentRes = await fetch(currentUrl, { signal: AbortSignal.timeout(8000) });
|
||||
if (!currentRes.ok) {
|
||||
log.warn(`API Fehler: ${currentRes.status}`);
|
||||
log.warn(`API error: ${currentRes.status}`);
|
||||
return res.json({ data: null });
|
||||
}
|
||||
const currentJson = await currentRes.json();
|
||||
@@ -116,7 +116,7 @@ router.get('/', async (req, res) => {
|
||||
cache = { data, ts: Date.now() };
|
||||
res.json({ data });
|
||||
} catch (err) {
|
||||
log.warn('Fehler:', err.message);
|
||||
log.warn('Error:', err.message);
|
||||
res.json({ data: null }); // Fallback: Widget ausblenden, kein Error-Screen
|
||||
}
|
||||
});
|
||||
@@ -145,8 +145,8 @@ router.get('/icon/:code', async (req, res) => {
|
||||
res.setHeader('Cache-Control', 'public, max-age=86400'); // 24 Stunden
|
||||
upstream.body.pipe(res);
|
||||
} catch (err) {
|
||||
log.warn('Icon-Proxy Fehler:', err.message);
|
||||
res.status(502).json({ error: 'Icon-Proxy fehlgeschlagen.', code: 502 });
|
||||
log.warn('Icon proxy error:', err.message);
|
||||
res.status(502).json({ error: 'Icon proxy failed.', code: 502 });
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user