price update

This commit is contained in:
rezakarimi
2023-01-04 08:47:19 +03:30
commit 13b00e21cd
190 changed files with 22247 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
const { SitemapStream, streamToPromise } = require("sitemap");
const { Readable } = require("stream");
export default async (req, res) => {
// An array with your links
const links = [
{ url: "/page/news/36/", priority: 0.3 },
{ url: "/page/about", priority: 0.3 },
{ url: "/recruitment", priority: 0.3 },
{ url: "/contact-us", priority: 0.3 }
];
// Create a stream to write to
const stream = new SitemapStream({ hostname: `https://${req.headers.host}` });
res.writeHead(200, {
"Content-Type": "application/xml",
});
const xmlString = await streamToPromise(
Readable.from(links).pipe(stream)
).then((data) => data.toString());
res.end(xmlString);
};