bun.sh -> bun.com (#20909)

This commit is contained in:
Jarred Sumner
2025-07-10 00:10:43 -07:00
committed by GitHub
parent 72b5c0885a
commit 55a9cccac0
214 changed files with 749 additions and 771 deletions

View File

@@ -2,7 +2,7 @@
name: Stream a file as an HTTP Response
---
This snippet reads a file from disk using [`Bun.file()`](https://bun.sh/docs/api/file-io#reading-files-bun-file). This returns a `BunFile` instance, which can be passed directly into the `new Response` constructor.
This snippet reads a file from disk using [`Bun.file()`](https://bun.com/docs/api/file-io#reading-files-bun-file). This returns a `BunFile` instance, which can be passed directly into the `new Response` constructor.
```ts
const path = "/path/to/file.txt";
@@ -30,7 +30,7 @@ new Response(Bun.file("./img.png")).headers.get("Content-Type");
---
Putting it all together with [`Bun.serve()`](https://bun.sh/docs/api/http#bun-serve).
Putting it all together with [`Bun.serve()`](https://bun.com/docs/api/http#bun-serve).
```ts
// static file server
@@ -45,4 +45,4 @@ Bun.serve({
---
See [Docs > API > File I/O](https://bun.sh/docs/api/file-io#writing-files-bun-write) for complete documentation of `Bun.write()`.
See [Docs > API > File I/O](https://bun.com/docs/api/file-io#writing-files-bun-write) for complete documentation of `Bun.write()`.