aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Diogo Goncalves <goncalvesdiogo99@gmail.com> 2023-09-11 04:34:04 +1000
committerGravatar GitHub <noreply@github.com> 2023-09-10 11:34:04 -0700
commit07c88435e0aede1d58bf462ef56270ca43d4e961 (patch)
tree753abac5257fb38c787065287b01064c40aab677
parent7121c1d6abac65d4a8feb4be5be69062f185c4fc (diff)
downloadbun-07c88435e0aede1d58bf462ef56270ca43d4e961.tar.gz
bun-07c88435e0aede1d58bf462ef56270ca43d4e961.tar.zst
bun-07c88435e0aede1d58bf462ef56270ca43d4e961.zip
Replace unnecessary '`' wih `"` in code snippets (#4792)
-rw-r--r--docs/api/http.md12
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/api/http.md b/docs/api/http.md
index 770b46478..629570335 100644
--- a/docs/api/http.md
+++ b/docs/api/http.md
@@ -13,7 +13,7 @@ Start an HTTP server in Bun with `Bun.serve`.
```ts
Bun.serve({
fetch(req) {
- return new Response(`Bun!`);
+ return new Response("Bun!");
},
});
```
@@ -24,9 +24,9 @@ The `fetch` handler handles incoming requests. It receives a [`Request`](https:/
Bun.serve({
fetch(req) {
const url = new URL(req.url);
- if (url.pathname === "/") return new Response(`Home page!`);
+ if (url.pathname === "/") return new Response("Home page!");
if (url.pathname === "/blog") return new Response("Blog!");
- return new Response(`404!`);
+ return new Response("404!");
},
});
```
@@ -38,7 +38,7 @@ Bun.serve({
port: 8080, // defaults to $BUN_PORT, $PORT, $NODE_PORT otherwise 3000
hostname: "mydomain.com", // defaults to "0.0.0.0"
fetch(req) {
- return new Response(`404!`);
+ return new Response("404!");
},
});
```
@@ -192,7 +192,7 @@ import {type Serve} from "bun";
export default {
fetch(req) {
- return new Response(`Bun!`);
+ return new Response("Bun!");
},
} satisfies Serve;
```
@@ -254,7 +254,7 @@ Below are Bun and Node.js implementations of a simple HTTP server that responds
```ts#Bun
Bun.serve({
fetch(req: Request) {
- return new Response(`Bun!`);
+ return new Response("Bun!");
},
port: 3000,
});