From cc1ea092a32180843cc3ab09c75abdb067f3b753 Mon Sep 17 00:00:00 2001 From: Mark Evola Date: Mon, 13 Jan 2025 23:23:51 -0600 Subject: [PATCH] pipe the html in the serverless fn --- api/ssr.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/ssr.js b/api/ssr.js index a8225d2..71ef458 100644 --- a/api/ssr.js +++ b/api/ssr.js @@ -15,9 +15,11 @@ export default async function handler(req, res) { return; } - const { body, statusCode, headers } = httpResponse; + const { statusCode, headers } = httpResponse; console.log("Status code: ", statusCode); res.statusCode = statusCode; headers.forEach(([name, value]) => res.setHeader(name, value)); - res.end(body); + // res.end(body); + // We're streaming the HTML response from the server to the client. + httpResponse.pipe(res); }