Keep the feed handler simple
This commit is contained in:
parent
34a215eb7b
commit
e21de55d3f
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user