import { ImageResponse, NextRequest } from 'next/server'; export const config = { runtime: 'edge', }; export default async function handler(req: NextRequest) { const { searchParams } = new URL(req.url); const title = searchParams.get('title') || 'Document signing, finally open source.'; const [imageData, InterFontData] = await Promise.all([ fetch(new URL('../../../assets/background-blog-og.png', import.meta.url)).then(async (res) => res.arrayBuffer(), ), fetch(new URL('../../../assets/Inter-Bold.ttf', import.meta.url)).then(async (res) => res.arrayBuffer(), ), ]); return new ImageResponse( (

{title}

), { width: 1200, height: 630, fonts: [ { name: 'Inter', data: InterFontData, style: 'normal', weight: 700, }, ], }, ); }