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

<!-- agent-signals: reading_time_min: 1 · est_tokens: 164 · updated: 2026-07-28 -->
Related: [Common HTTP server usage](/guides/http/server.md), [Write a simple HTTP server](/guides/http/simple.md), [Send an HTTP request using fetch](/guides/http/fetch.md), [Start a cluster of HTTP servers](/guides/http/cluster.md), [Configure TLS on an HTTP server](/guides/http/tls.md), [Proxy HTTP requests using fetch()](/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 icon="terminal" title="terminal" 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 icon="/icons/typescript.svg" title="index.ts"
Bun.serve({
  port: 3000,
  fetch(req) {
    return new Response("Hello world");
  },
});
```
