Spaces:
Sleeping
Sleeping
Download app/api/og/route.tsx from 00Boobs00/InstantCoder: direct link, hf CLI and curl.
- Browser
- Download file 915 Bytes
-
https://huggingface.co/spaces/00Boobs00/InstantCoder/resolve/main/app/api/og/route.tsx
- Command line
-
hf download hf://spaces/00Boobs00/InstantCoder/app/api/og/route.tsx
-
curl -L -o route.tsx https://huggingface.co/spaces/00Boobs00/InstantCoder/resolve/main/app/api/og/route.tsx
915 Bytes
| import { ImageResponse } from "next/og"; | |
| import { domain } from "@/utils/domain"; | |
| export async function GET(request: Request) { | |
| const { searchParams } = new URL(request.url); | |
| const prompt = searchParams.get("prompt"); | |
| return new ImageResponse( | |
| ( | |
| <div | |
| style={{ | |
| backgroundImage: `url(${domain}/dynamic-og.png)`, | |
| backgroundSize: "1200px 630px", | |
| backgroundRepeat: "no-repeat", | |
| backgroundPosition: "center center", | |
| fontSize: 50, | |
| color: "black", | |
| background: "white", | |
| width: "100%", | |
| height: "100%", | |
| padding: "50px 200px", | |
| textAlign: "center", | |
| justifyContent: "center", | |
| alignItems: "center", | |
| }} | |
| > | |
| {prompt && prompt.length > 100 ? prompt.slice(0, 97) + "..." : prompt} | |
| </div> | |
| ), | |
| { | |
| width: 1200, | |
| height: 630, | |
| }, | |
| ); | |
| } | |