This commit is contained in:
ryanchristo 2026-11-19 13:47:56 -08:00
parent 71590024e7
commit c135cb24f1
No known key found for this signature in database
7 changed files with 97 additions and 3 deletions

View file

@ -0,0 +1,41 @@
import { Feed } from "feed";
import { getArtifacts } from "utils";
const SITE_URL = "https://chora.io/artifacts/choreography";
function getAllArtifacts() {
return [
...getArtifacts('choreography'),
]
}
export const revalidate = false;
export async function GET() {
const feed = new Feed({
title: "chora artifacts (choreography)",
description: "chora artifacts (choreography)",
id: SITE_URL,
link: SITE_URL,
language: "en",
feedLinks: { rss2: `${SITE_URL}/feed.xml` },
ttl: 60,
});
for (const a of getAllArtifacts()) {
feed.addItem({
title: a.title,
id: `${SITE_URL}/${a.id}`,
link: `${SITE_URL}/${a.id}`,
description: a.description,
date: a.created,
});
}
return new Response(feed.rss2(), {
headers: {
"Content-Type": "application/rss+xml; charset=utf-8",
"Cache-Control": "public, max-age=3600",
},
});
}