From 34c5d083c630dfa842acb1f3bec26cad96b97fb9 Mon Sep 17 00:00:00 2001 From: Jarred Sumner Date: Sun, 5 May 2024 21:54:25 -0700 Subject: [PATCH] Update http.md --- docs/api/http.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/api/http.md b/docs/api/http.md index da8089f2117741..1f873dbb5d012a 100644 --- a/docs/api/http.md +++ b/docs/api/http.md @@ -58,14 +58,13 @@ Bun.serve({ }); ``` -Optionally, you can also access the `Server` object from the `fetch` handler. +You can also access the `Server` object from the `fetch` handler. It's the second argument passed to the `fetch` function. ```ts // `server` is passed in as the second argument to `fetch`. const server = Bun.serve({ fetch(req, server) { const ip = server.requestIP(req); - return new Response(`Your IP is ${ip}`); }, });