DenoDDeno
Powered by
LeonL
Denoβ€’2y agoβ€’
6 replies
Leon

How To Add .done method for new Response();

Add a .done method to new Response() to ensure that the response was delivered to the client.

function handler(_req) {
const res = new Response(null, { headers });

if(res.done) {
// ... Execute if the response is guaranteed to be delivered to the client.
}

return res;
}
Deno.serve({ port: 80, handler });
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

How to add a simple live reload?
Kevin TaleKKevin Tale / help
16mo ago
How add custom colors to twind config?
mioeMmioe / help
4y ago