# Hot reload an HTTP server (/docs/guides/http/hot)

<!-- agent-signals: reading_time_min: 1 · est_tokens: 158 · updated: 2026-07-28 -->
Related: [Common HTTP server usage](/docs/guides/http/server.md), [Write a simple HTTP server](/docs/guides/http/simple.md), [Send an HTTP request using fetch](/docs/guides/http/fetch.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)

The [`--hot`](/runtime/watch-mode#hot-mode) flag runs a file with hot reloading enabled. When any module or file changes, Bun re-runs the file.

```sh terminal icon="terminal"
bun --hot run index.ts
```

***

Bun detects when you are running an HTTP server with `Bun.serve()`. It reloads your fetch handler when source files change, *without* restarting the `bun` process. This makes hot reloads nearly instantaneous.

<Note>
  Hot reloading doesn't reload the page in your browser.
</Note>

```ts index.ts icon="/icons/typescript.svg"
Bun.serve({
  port: 3000,
  fetch(req) {
    return new Response("Hello world");
  },
});
```
