import { ImageResponse } from '@vercel/og' import { NextRequest } from 'next/server' export const config = { runtime: 'experimental-edge', } export default async function handler(req: NextRequest) { const { searchParams } = req.nextUrl const username = searchParams.get('username') if (!username) { return new ImageResponse(<>{'Visit with "?username=vercel"'}, { width: 1200, height: 630, }) } return new ImageResponse( (
{/* eslint-disable-next-line @next/next/no-img-element */} avatar

github.com/{username}

), { width: 1200, height: 630, } ) }