web/src/app/sitemap.xml/page.jsx

30 lines
673 B
JavaScript

async function getData(id) {
const res = await fetch(`https://storage.vesmeh.com/site-maps/site-map.xml`);
const xml = await res.text();
return xml;
}
export default async function Sitemap() {
const localUrl = [
{
url: "https://acme.com",
lastModified: new Date(),
changeFrequency: "yearly",
priority: 1,
},
{
url: "https://acme.com/about",
lastModified: new Date(),
changeFrequency: "monthly",
priority: 0.8,
},
{
url: "https://acme.com/blog",
lastModified: new Date(),
changeFrequency: "weekly",
priority: 0.5,
},
];
return (await getData()).concat(localUrl);
}