import { serve, file, sleep } from "bun";
import { readFileSync } from "node:fs";
serve({
port: 443,
key: file("./utility/localhost.key"),
cert: file("./utility/localhost.crt"),
async fetch(request, server) {
await sleep(1000);
return new Response(file("./index.html")); // ==============> Wrong
//return new Response(readFileSync("./index.html","utf-8")); ====> OK
//return new Response("aaaaa"); === =================> OK
},
});
What is the expected behavior?
i use sleep() in fetch method , all things above is ok, but response by Bun.file
when i send request with browser; bun stops and exit, without show any error.
What version of Bun is running?
1.1.25+fe62a6140
What platform is your computer?
windows10 x64
What steps can reproduce the bug?
What is the expected behavior?
i use sleep() in fetch method , all things above is ok, but response by Bun.file when i send request with browser; bun stops and exit, without show any error.
What do you see instead?
No response
Additional information
No response