1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-27 17:50:29 -04:00
jarv.is/pages/feed.xml.ts

20 lines
411 B
TypeScript

import { buildFeed } from "../lib/build-feed";
import type { GetServerSideProps } from "next";
const RssPage = () => null;
export const getServerSideProps: GetServerSideProps = async (context) => {
const feed = buildFeed();
const { res } = context;
res.setHeader("content-type", "application/rss+xml");
res.write(feed.rss2());
res.end();
return {
props: {},
};
};
export default RssPage;