mirror of
https://github.com/LukeHagar/sveltekit-og.git
synced 2025-12-08 12:47:44 +00:00
v3 initialized
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
import OG from './OG.svelte';
|
||||
import type { RequestHandler } from '@sveltejs/kit';
|
||||
import { componentToImageResponse } from '@ethercorps/sveltekit-og';
|
||||
import { ImageResponse } from '@ethercorps/sveltekit-og';
|
||||
|
||||
const fontFile = await fetch('https://og-playground.vercel.app/inter-latin-ext-700-normal.woff');
|
||||
const fontData: ArrayBuffer = await fontFile.arrayBuffer();
|
||||
export const GET: RequestHandler = async ({fetch}) => {
|
||||
|
||||
export const GET: RequestHandler = async () => {
|
||||
return componentToImageResponse(
|
||||
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,
|
||||
{ text: 'Ready to dive in?', spanText: 'Start your free trial today.' },
|
||||
{
|
||||
height: 250,
|
||||
width: 500,
|
||||
@@ -19,6 +19,7 @@ export const GET: RequestHandler = async () => {
|
||||
weight: 700
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{ text: 'Ready to dive in?', spanText: 'Start your free trial today.' }
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user