MCPcopy
hub / github.com/vitejs/vite / handler

Function handler

playground/environment-react-ssr/src/entry-server.tsx:5–10  ·  view source on GitHub ↗
(_req, res)

Source from the content-addressed store, hash-verified

3import Root from './root'
4
5const handler: Connect.NextHandleFunction = async (_req, res) => {
6 const ssrHtml = ReactDomServer.renderToString(<Root />)
7 let html = await importHtml()
8 html = html.replace(/<body>/, `<body><div id="root">${ssrHtml}</div>`)
9 res.setHeader('content-type', 'text/html').end(html)
10}
11
12export default handler
13

Callers

nothing calls this directly

Calls 1

importHtmlFunction · 0.85

Tested by

no test coverage detected