Replace old docs with new docs repo (#24201)

This commit is contained in:
Lydia Hallie
2025-11-05 11:14:21 -08:00
committed by GitHub
parent 550522e99b
commit 1606a9f24e
407 changed files with 21970 additions and 17527 deletions

View File

@@ -0,0 +1,20 @@
---
title: Write a simple HTTP server
sidebarTitle: Simple HTTP Server with Bun
mode: center
---
This starts an HTTP server listening on port `3000`. It responds to all requests with a `Response` with status `200` and body `"Welcome to Bun!"`.
See [`Bun.serve`](https://bun.com/docs/api/http) for details.
```ts server.ts icon="/icons/typescript.svg"
const server = Bun.serve({
port: 3000,
fetch(request) {
return new Response("Welcome to Bun!");
},
});
console.log(`Listening on ${server.url}`);
```