Created
September 10, 2020 15:51
-
-
Save alastaircoote/100fdc34a48f96d0057679656bcee400 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const stream = new ReadableStream({ | |
start: async function(controller) { | |
controller.enqueue("<html>"); | |
let content = await getSomeContent(); | |
controller.enqueue(content); | |
controller.enqueue("</html>"); | |
} | |
}); | |
let r = new Response(stream,{ | |
status: 200, | |
headers: { | |
"Content-Type": "text/html" | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment