# Write a simple HTTP server (/docs/guides/http/simple)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 101 · updated: 2026-07-28 -->
Related: [Common HTTP server usage](/docs/guides/http/server.md), [Send an HTTP request using fetch](/docs/guides/http/fetch.md), [Hot reload an HTTP server](/docs/guides/http/hot.md), [Start a cluster of HTTP servers](/docs/guides/http/cluster.md), [Configure TLS on an HTTP server](/docs/guides/http/tls.md), [Proxy HTTP requests using fetch()](/docs/guides/http/proxy.md)

This code starts an HTTP server listening on port `3000`. It responds to every request with a `200` status and the body `"Welcome to Bun!"`.

See [`Bun.serve`](/runtime/http/server) 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}`);
```
