export async function getServerSideProps({ res }) { const baseUrl = "http://localhost:2100"; // LIST URL yang mau dimasukin ke sitemap const links = [ { url: "/", changefreq: "daily", priority: 1.0 }, { url: "/shop/brands", changefreq: "weekly", priority: 0.8 }, { url: "/shop/promo", changefreq: "weekly", priority: 0.8 }, { url: "/tentang-kami", changefreq: "monthly", priority: 0.5 }, ]; // generate XML const xml = ` ${links .map((link) => { return ` ${baseUrl}${link.url} ${new Date().toISOString()} ${link.changefreq} ${link.priority} `; }) .join("")} `; res.setHeader("Content-Type", "text/xml"); res.write(xml); res.end(); return { props: {}, }; } export default function Sitemap() { return null; }