mirror of
https://github.com/koala73/worldmonitor.git
synced 2026-04-25 17:14:57 +02:00
Fix PizzINT routes with explicit endpoint files
- Replace catch-all route with explicit files - api/pizzint/dashboard-data.js for /api/pizzint/dashboard-data - api/pizzint/gdelt/batch.js for /api/pizzint/gdelt/batch - Improve rss-proxy error handling with more details
This commit is contained in:
@@ -96,8 +96,13 @@ export default async function handler(req) {
|
||||
});
|
||||
} catch (error) {
|
||||
const isTimeout = error.name === 'AbortError';
|
||||
return new Response(JSON.stringify({ error: isTimeout ? 'Feed timeout' : 'Failed to fetch feed' }), {
|
||||
status: isTimeout ? 504 : 500,
|
||||
console.error('RSS proxy error:', feedUrl, error.message);
|
||||
return new Response(JSON.stringify({
|
||||
error: isTimeout ? 'Feed timeout' : 'Failed to fetch feed',
|
||||
details: error.message,
|
||||
url: feedUrl
|
||||
}), {
|
||||
status: isTimeout ? 504 : 502,
|
||||
headers: { 'Content-Type': 'application/json', 'Access-Control-Allow-Origin': '*' },
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user