route.tsx 919 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { ImageResponse } from "next/og";
  2. export const runtime = "edge";
  3. export async function GET() {
  4. const geistSemiBold = await fetch(
  5. new URL("../fonts/GeistVF.woff", import.meta.url),
  6. ).then((res) => res.arrayBuffer());
  7. return new ImageResponse(
  8. <div
  9. style={{
  10. width: "100%",
  11. height: "100%",
  12. display: "flex",
  13. alignItems: "center",
  14. justifyContent: "center",
  15. backgroundColor: "black",
  16. }}
  17. >
  18. <span
  19. style={{
  20. fontSize: 72,
  21. fontFamily: "Geist",
  22. fontWeight: 600,
  23. color: "white",
  24. letterSpacing: "-0.02em",
  25. }}
  26. >
  27. json-render
  28. </span>
  29. </div>,
  30. {
  31. width: 1200,
  32. height: 630,
  33. fonts: [
  34. {
  35. name: "Geist",
  36. data: geistSemiBold,
  37. style: "normal",
  38. weight: 600,
  39. },
  40. ],
  41. },
  42. );
  43. }