Aktuelles: preusmeritve, breaking-news in noga kazejo na folx.news namesto na news.folx.tv
This commit is contained in:
+4
-4
@@ -1076,13 +1076,13 @@ export async function registerRoutes(
|
||||
app.get("/api/breaking-news", async (_req, res) => {
|
||||
// 31. 8. 2026: blok Aktuelle Nachrichten je vodil na tagesschau, n-tv, ORF
|
||||
// in Welt, torej smo obiskovalce posiljali s strani. Zdaj kaze nase novice
|
||||
// z news.folx.tv, kjer imamo oglase.
|
||||
// z folx.news (locena domena, brez oglasov).
|
||||
const cacheKey = "breaking-news";
|
||||
const cached = getCached<any[]>(cacheKey, 5 * 60 * 1000);
|
||||
if (cached) return res.json(cached);
|
||||
|
||||
try {
|
||||
const r = await fetch("https://news.folx.tv/api/articles", {
|
||||
const r = await fetch("https://folx.news/api/articles", {
|
||||
headers: { "user-agent": "folx.tv-widget" },
|
||||
signal: AbortSignal.timeout(10000),
|
||||
});
|
||||
@@ -1114,14 +1114,14 @@ export async function registerRoutes(
|
||||
|
||||
const items = kroznik.map((a) => ({
|
||||
title: String(a.title),
|
||||
link: `https://news.folx.tv/${a.slug}`,
|
||||
link: `https://folx.news/${a.slug}`,
|
||||
source: String(a.category || "FOLX NEWS"),
|
||||
pubDate: relativniCas(a.publishedAt),
|
||||
}));
|
||||
if (items.length > 0) setCache(cacheKey, items);
|
||||
res.json(items);
|
||||
} catch (err: any) {
|
||||
console.log("[breaking-news] news.folx.tv error:", err.message);
|
||||
console.log("[breaking-news] folx.news error:", err.message);
|
||||
const stale = getStale<any[]>(cacheKey);
|
||||
res.json(stale || []);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user