From 1dd31494f0e270f24c2caad411e271b9bf5c781c Mon Sep 17 00:00:00 2001 From: Mhykol Date: Fri, 21 Jun 2024 08:31:02 -0400 Subject: Added rss feed for blog --- app.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'app.js') diff --git a/app.js b/app.js index bb8e066..9b95eb1 100644 --- a/app.js +++ b/app.js @@ -32,6 +32,7 @@ const assetDir = [ 'vid' ] require('dotenv').config() +const rss = require('./source/rss')({baseUrl: process.env.baseUrl}) // Handles the routes class App { @@ -77,12 +78,18 @@ class App { this.data = this.readfile.GetRobots() this.data.mime.then(output => this.#FileOpen({data: this.data, mime: output, res: res})) break + case 'rss': + rss.GetFeed({ + title: process.env.rssTitle, + description: process.env.rssDescription, + author: process.env.rssAuthor + }).then(output => res.send(output)) + break default: if (this.path.string.endsWith('/') && this.path.string.length > 1) this.path.string = this.path.string.substring(0, this.path.string.length - 1) if (output.has(this.path.string)) { try { output.get(this.path.string).then(output => { - console.log(output.meta) res.send(this.readfile.GetMain(output.meta)) }) } catch { -- cgit v1.2.3-70-g09d2