diff options
| author | Mhykol <mchaeldonald62@pm.me> | 2024-10-13 02:51:51 -0400 |
|---|---|---|
| committer | Mhykol <mchaeldonald62@pm.me> | 2024-10-13 02:51:51 -0400 |
| commit | 611aa084110b24dc00757bc02f647f1675df8dda (patch) | |
| tree | fa34014f84210a33727d06f6d108084518345e41 /app.js | |
| parent | e8996373a6dad0bdd6fc6926386b4262730ac279 (diff) | |
Added sitemap
Diffstat (limited to 'app.js')
| -rw-r--r-- | app.js | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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, |
