mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-26 18:48:28 -04:00
22 lines
537 B
TypeScript
22 lines
537 B
TypeScript
import { buildFeed } from "../lib/build-feed";
|
|
import type { GetServerSideProps } from "next";
|
|
|
|
const AtomFeed = () => null;
|
|
|
|
export const getServerSideProps: GetServerSideProps = async (context) => {
|
|
const feed = buildFeed();
|
|
const { res } = context;
|
|
|
|
res.setHeader("content-type", "application/atom+xml; charset=utf-8");
|
|
// cache on edge for one hour
|
|
res.setHeader("cache-control", "s-maxage=3600, stale-while-revalidate");
|
|
res.write(feed.atom1());
|
|
res.end();
|
|
|
|
return {
|
|
props: {},
|
|
};
|
|
};
|
|
|
|
export default AtomFeed;
|