diff --git a/src/handlers/feed.ts b/src/handlers/feed.ts index 807725c..e411cff 100644 --- a/src/handlers/feed.ts +++ b/src/handlers/feed.ts @@ -1,15 +1,19 @@ import { Hono, Context } from 'hono'; +import { PostService } from '@blog/services/post-file'; import { Feed } from 'feed'; -const feed = new Hono(); +const feed = new Hono<{ Variables: { postService: PostService }}>(); let feedBuffer: string = ""; export async function getFeedFile(c: Context) { c.header('Content-Type', 'text/xml'); if (!feedBuffer) { - // get the post meta + const postService: PostService = c.get('postService'); + const posts = postService.getPublishedPosts(); + // get the site meta + // create the feed // get the feed data feedBuffer = "";