From 611aa084110b24dc00757bc02f647f1675df8dda Mon Sep 17 00:00:00 2001 From: Mhykol Date: Sun, 13 Oct 2024 02:51:51 -0400 Subject: Added sitemap --- app.js | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app.js') diff --git a/app.js b/app.js index 7e94983..84c283c 100644 --- a/app.js +++ b/app.js @@ -14,6 +14,7 @@ const mime = { html: 'text/html', txt: 'text/plain', css: 'text/css', + xml: 'text/xml', gif: 'image/gif', jpg: 'image/jpeg', png: 'image/png', @@ -78,7 +79,15 @@ class App { this.data = this.readfile.GetRobots() this.data.mime.then(output => this.#FileOpen({data: this.data, mime: output, res: res})) break + case 'sitemap.xml': + this.data = this.readfile.Sitemap({keys: Array.from(output.keys()), url: process.env.baseUrl}) + this.data.then(data => { + res.set('Content-Type', mime.xml) + res.send(data) + }) + break case 'rss': + res.set('Content-Type', mime.xml) rss.GetFeed({ title: process.env.rssTitle, description: process.env.rssDescription, -- cgit v1.2.3-70-g09d2