Skip to content

Commit

Permalink
refactor fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
swyxio committed Nov 28, 2022
1 parent 142b51a commit 6335889
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/routes/api/blog/[slug].json/+server.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { error } from '@sveltejs/kit';
/**
* @type {import('@sveltejs/kit').RequestHandler}
*/
export async function GET({ params }) {
export async function GET({ fetch, params }) {
const { slug } = params;
let data;
try {
data = await getContent(slug);
data = await getContent(fetch, slug);
return new Response(JSON.stringify(data), {
headers: {
'Cache-Control': `max-age=0, s-maxage=${60}` // 1 minute.. for now
Expand Down

0 comments on commit 6335889

Please sign in to comment.