Skip to main content
Bun.file() accepts a path and returns a lazily-loaded BunFile instance, which you can pass directly to the new Response constructor.
server.ts

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

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

See Bun.write().