Clanek s targetUrl se ob kliku preusmeri (302)

This commit is contained in:
sebastjan
2026-08-15 08:30:37 +02:00
parent f4acd541c5
commit 68fe291b55
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -64,6 +64,10 @@ export function serveStatic(app: Express) {
try {
const slug = decodeURIComponent(articleMatch[1]);
const article = await storage.getArticleBySlug(slug);
if (article && (article as any).targetUrl) {
res.redirect(302, (article as any).targetUrl);
return;
}
if (article) {
const articleUrl = `${canonicalBase}/article/${article.slug}`;
const imageUrl = ogImageUrl(article.coverImage || "", canonicalBase);