()
| 57 | |
| 58 | const { pipe, abort } = render({ |
| 59 | onShellReady() { |
| 60 | res.status(200).set({ 'Content-Type': 'text/html' }) |
| 61 | res.write(htmlStart) |
| 62 | |
| 63 | const stream = pipe(res) |
| 64 | |
| 65 | // `compression` buffers the response, so flush every chunk to keep it streaming |
| 66 | if (isProduction) { |
| 67 | stream.on('data', () => { |
| 68 | res.flush() |
| 69 | }) |
| 70 | } |
| 71 | stream.on('end', () => { |
| 72 | clearTimeout(abortTimeout) |
| 73 | res.end(htmlEnd) |
| 74 | }) |
| 75 | }, |
| 76 | onError(error) { |
| 77 | console.error(error) |
| 78 | if (!res.headersSent) { |
nothing calls this directly
no outgoing calls
no test coverage detected