import { ImageResponse } from 'next/og' import { baseURL } from '@/app/resources'; import { person } from '@/app/resources'; export const runtime = 'edge'; export async function GET(request: Request) { let url = new URL(request.url) let title = url.searchParams.get('title') || 'Portfolio' const font = fetch( new URL('../../../public/fonts/Inter.ttf', import.meta.url) ).then((res) => res.arrayBuffer()); const fontData = await font; return new ImageResponse( (
{title}
{person.name} {person.role}
), { width: 1920, height: 1080, fonts: [ { name: 'Inter', data: fontData, style: 'normal', }, ], } ) }