route.tsx 881 B

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