import {
renderString,
createRequestHandler,
} from '@modern-js/runtime/ssr/server';
const handleRequest = async (request, ServerRoot, options) => {
const body = await renderString(request, <ServerRoot />, options);
return new Response(body, {
headers: {
'content-type': 'text/html; charset=utf-8',
},
});
};
export default createRequestHandler(handleRequest);