mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
This avoids the case that one can accidentally return a `Response` object in the Node.js runtime in `pages/api/`, that causes the request to hang forever.
23 lines
420 B
JavaScript
23 lines
420 B
JavaScript
// /pages/api/og.jsx
|
|
import { ImageResponse } from '@vercel/og'
|
|
|
|
export default function () {
|
|
return new ImageResponse(
|
|
(
|
|
<div
|
|
style={{
|
|
width: '100%',
|
|
height: '100%',
|
|
display: 'flex',
|
|
alignItems: 'center',
|
|
justifyContent: 'center',
|
|
fontSize: 128,
|
|
background: 'lavender',
|
|
}}
|
|
>
|
|
Hello!
|
|
</div>
|
|
)
|
|
)
|
|
}
|