// Proposal for new feature Bun.serve({ async fetch(req) { const file = Bun.file("./bun.mp4"); // Optimized built-in method return new Response(await Bun.serveVideo(file, req)); }, }); Use code with caution. Copied to clipboard
Description * What version of Bun is running? 1.1.21+70ca2b76c. * What platform is your computer? Microsoft Windows NT 10.0.22631. bun.mp4
It would utilize a optimized stream pipeline to prevent memory leaks, resolving issues where large video fetches fail to release memory. // Proposal for new feature Bun