mirror of
https://github.com/LukeHagar/sveltekit-og.git
synced 2025-12-06 12:47:49 +00:00
26 lines
607 B
TypeScript
26 lines
607 B
TypeScript
import OG from './OG.svelte';
|
|
import type { RequestHandler } from '@sveltejs/kit';
|
|
import { ImageResponse } from '@ethercorps/sveltekit-og';
|
|
|
|
export const GET: RequestHandler = async ({fetch}) => {
|
|
|
|
const fontFile = await fetch('https://og-playground.vercel.app/inter-latin-ext-700-normal.woff');
|
|
const fontData: ArrayBuffer = await fontFile.arrayBuffer();
|
|
|
|
return new ImageResponse(
|
|
OG,
|
|
{
|
|
height: 250,
|
|
width: 500,
|
|
fonts: [
|
|
{
|
|
name: 'Inter Latin',
|
|
data: fontData,
|
|
weight: 700
|
|
}
|
|
]
|
|
},
|
|
{ text: 'Ready to dive in?', spanText: 'Start your free trial today.' }
|
|
);
|
|
};
|