import { renderToString } from 'react-dom/server' import { RemixServer } from '@remix-run/react' import type { EntryContext } from '@remix-run/react/dist/entry' export default function handleRequest ( request: Request, responseStatusCode: number, responseHeaders: Headers, remixContext: EntryContext ) { let markup = renderToString( ) responseHeaders.set('Content-Type', 'text/html') return new Response('' + markup, { status: responseStatusCode, headers: responseHeaders }) }