mirror of
https://github.com/resend/react-email.git
synced 2026-09-14 14:18:02 +08:00
6671a743d6
Signed-off-by: Gabriel Miranda <gabriel@resend.com> Signed-off-by: gabriel miranda <gabriel@resend.com>
19 lines
439 B
TypeScript
19 lines
439 B
TypeScript
import { render } from '@react-email/render';
|
|
|
|
export const runtime = 'edge';
|
|
|
|
export async function GET() {
|
|
try {
|
|
const html = await render(<div>testing element</div>, { pretty: true });
|
|
return new Response(html);
|
|
} catch (exception) {
|
|
let message = 'Some error ocurred';
|
|
if (exception instanceof Error) {
|
|
message = exception.toString();
|
|
}
|
|
return new Response(message, {
|
|
status: 500,
|
|
});
|
|
}
|
|
}
|