This repository has been archived on 2025-03-28. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
coryd.dev-astro/src/pages/feeds/books.xml.js

23 lines
541 B
JavaScript

import { generateRssFeed } from "@utils/generateRssFeed";
import { fetchGlobals } from "@utils/data/globals.js";
import { fetchBooks } from "@utils/data/books.js";
export async function GET() {
const [globals, books] = await Promise.all([
fetchGlobals(),
fetchBooks(),
]);
const rss = generateRssFeed({
permalink: "/feeds/books.xml",
title: "Books feed",
globals,
data: books.feed,
});
return new Response(rss, {
status: 200,
headers: {
"Content-Type": "application/rss+xml",
},
});
}