v3 initialized

This commit is contained in:
Shivam Meena
2023-12-13 22:39:41 +05:30
parent a62b831fa6
commit d4663f8123
61 changed files with 296 additions and 3778 deletions

View File

@@ -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.' }
);
};