mirror of
https://github.com/LukeHagar/sveltekit-og.git
synced 2025-12-08 04:21:44 +00:00
netlify test
This commit is contained in:
24
examples/netlify-build/src/routes/cog/+server.ts
Normal file
24
examples/netlify-build/src/routes/cog/+server.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import OG from './OG.svelte';
|
||||
import type { RequestHandler } from '@sveltejs/kit';
|
||||
import { componentToImageResponse } 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 () => {
|
||||
return componentToImageResponse(
|
||||
OG,
|
||||
{ text: 'Ready to dive in?', spanText: 'Start your free trial today.' },
|
||||
{
|
||||
height: 250,
|
||||
width: 500,
|
||||
fonts: [
|
||||
{
|
||||
name: 'Inter Latin',
|
||||
data: fontData,
|
||||
weight: 700
|
||||
}
|
||||
]
|
||||
}
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user