Skip to content

Commit

Permalink
feat: atom and json endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-shuman committed Aug 29, 2024
1 parent 390848d commit 3440750
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/routes/atom/+server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { generateFeed, getLinks } from '$lib/rss';
import { type RequestHandler } from '@sveltejs/kit';

export const GET: RequestHandler = async () => {
return new Response(generateFeed(getLinks()).atom1(), {
headers: {
'Content-Type': 'application/rss+xml'
},
status: 200,
statusText: 'link added successfully'
});
};
12 changes: 12 additions & 0 deletions src/routes/json/+server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { generateFeed, getLinks } from '$lib/rss';
import { type RequestHandler } from '@sveltejs/kit';

export const GET: RequestHandler = async () => {
return new Response(generateFeed(getLinks()).json1(), {
headers: {
'Content-Type': 'application/json'
},
status: 200,
statusText: 'link added successfully'
});
};

0 comments on commit 3440750

Please sign in to comment.