Bun.file()
. This returns a BunFile
instance, which can be passed directly into the new Response
constructor.
The
Content-Type
is read from the file and automatically set on the Response
.
Putting it all together with
Bun.serve()
.
See Docs > API > File I/O for complete documentation of
Bun.write()
.