import { ImageResponse } from "next/og"; import { NextRequest } from "next/server"; export const runtime = "edge"; export async function GET(props: NextRequest) { const url = new URL(props.url); const title = url.searchParams.get("title"); const description = url.searchParams.get("description"); const author = url.searchParams.get("author"); const github = url.searchParams.get("github_username"); const images = url.searchParams.get("images"); const image_origin_url = process.env.NODE_ENV !== "development" ? "https://raj.how" : "http://localhost:3000"; return new ImageResponse( (
og
{title?.toString()} {description?.toString()}
{author?.toString()}
{images ? ( og ) : null}
), { width: 1200, height: 630, }, ); }