import React from "react"; import type { NextApiResponse } from 'next' const Sitemap = () => { return null; }; type Props = { res: NextApiResponse } export const getServerSideProps = async ({ res }: Props) => { const BASE_URL = process.env.NEXT_PUBLIC_URL || "http://localhost:3000"; const staticPaths = [ { url: `${BASE_URL}/`, priority: 1.0, }, { url: `${BASE_URL}/resume`, priority: 1.0, }, ].sort((a, b) => b.priority - a.priority) const allPaths = [...staticPaths]; const sitemap = ` ${allPaths .map(({ url, priority }) => { return ` ${url} ${new Date().toISOString()} weekly ${priority} `; }) .join("")} `; res.setHeader("Content-Type", "text/xml"); res.write(sitemap); res.end(); return { props: {}, }; }; export default Sitemap;