Keep the feed handler simple

This commit is contained in:
Dave Smith-Hayes 2024-10-22 21:30:20 -04:00
parent 34a215eb7b
commit e21de55d3f

View File

@ -1,11 +1,21 @@
import { Hono, Context } from 'hono'; import { Hono, Context } from 'hono';
import { Feed } from 'feed'; import { Feed } from 'feed';
const feed = new Hono<{ Variables: { feed: Feed }}>(); const feed = new Hono();
let feedBuffer: string = "";
export async function getFeedFile(c: Context) { export async function getFeedFile(c: Context) {
c.header('content-type', 'text/xml'); c.header('Content-Type', 'text/xml');
c.body("");
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); feed.get('/rss.xml', getFeedFile);