aboutsummaryrefslogtreecommitdiff
path: root/docs/api/http.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/api/http.md')
-rw-r--r--docs/api/http.md6
1 files changed, 2 insertions, 4 deletions
diff --git a/docs/api/http.md b/docs/api/http.md
index 629570335..3f476feb2 100644
--- a/docs/api/http.md
+++ b/docs/api/http.md
@@ -71,7 +71,7 @@ In development mode, Bun will surface errors in-browser with a built-in error pa
{% image src="/images/exception_page.png" caption="Bun's built-in 500 page" /%}
-To handle server-side errors, implement an `error` handler. This function should return a `Response` to served to the client when an error occurs. This response will supercede Bun's default error page in `development` mode.
+To handle server-side errors, implement an `error` handler. This function should return a `Response` to serve to the client when an error occurs. This response will supersede Bun's default error page in `development` mode.
```ts
Bun.serve({
@@ -212,9 +212,7 @@ $ bun --hot server.ts
To stream a file, return a `Response` object with a `BunFile` object as the body.
```ts
-import { serve, file } from "bun";
-
-serve({
+Bun.serve({
fetch(req) {
return new Response(Bun.file("./hello.txt"));
},