From e21de55d3f136543727798c4516c8fa62653d005 Mon Sep 17 00:00:00 2001 From: Dave Smith-Hayes Date: Tue, 22 Oct 2024 21:30:20 -0400 Subject: [PATCH] Keep the feed handler simple --- src/handlers/feed.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/handlers/feed.ts b/src/handlers/feed.ts index aaa9295..807725c 100644 --- a/src/handlers/feed.ts +++ b/src/handlers/feed.ts @@ -1,11 +1,21 @@ import { Hono, Context } from 'hono'; import { Feed } from 'feed'; -const feed = new Hono<{ Variables: { feed: Feed }}>(); +const feed = new Hono(); +let feedBuffer: string = ""; export async function getFeedFile(c: Context) { - c.header('content-type', 'text/xml'); - c.body(""); + c.header('Content-Type', 'text/xml'); + + if (!feedBuffer) { + // get the post meta + // get the site meta + // create the feed + // get the feed data + feedBuffer = ""; + } + + c.body(feedBuffer); } feed.get('/rss.xml', getFeedFile);