Skip to content

Commit

Permalink
Replace unnecessary '' wih "` in code snippets (oven-sh#4792)
Browse files Browse the repository at this point in the history
  • Loading branch information
diogo405 authored and paperdave committed Sep 18, 2023
1 parent c1606c4 commit ad3301e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions docs/api/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
},
});
```
Expand All @@ -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!");
},
});
```
Expand All @@ -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!");
},
});
```
Expand Down Expand Up @@ -192,7 +192,7 @@ import {type Serve} from "bun";

export default {
fetch(req) {
return new Response(`Bun!`);
return new Response("Bun!");
},
} satisfies Serve;
```
Expand Down Expand Up @@ -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,
});
Expand Down

0 comments on commit ad3301e

Please sign in to comment.