Skip to main content
Bun.file() reads a file from disk and returns a BunFile instance, which you can pass directly to the new Response constructor.
server.ts

Bun reads the Content-Type from the file and sets it on the Response.
server.ts

Putting it all together with Bun.serve().
server.ts

See Bun.write().