webcompile/src/routes/blog/[title]/+page.server.ts
2023-01-01 01:21:53 +02:00

11 lines
255 B
TypeScript

import type { PageServerLoad } from "./$types";
import fetchApi from "$lib/ghost";
export const load = (async ({ params }) => {
const data = await fetchApi("posts/slug/" + params.title);
return {
post: data.posts[0]
};
}) satisfies PageServerLoad;