diff options
Diffstat (limited to 'docs/api')
-rw-r--r-- | docs/api/http.md | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/docs/api/http.md b/docs/api/http.md index 1029972a6..ec32274d7 100644 --- a/docs/api/http.md +++ b/docs/api/http.md @@ -189,7 +189,7 @@ Bun.serve({ }); ``` -## Hot reloading +## Object syntax Thus far, the examples on this page have used the explicit `Bun.serve` API. Bun also supports an alternate syntax. @@ -203,15 +203,15 @@ export default { } satisfies Serve; ``` -Instead of passing the server options into `Bun.serve`, export it. This file can be executed as-is; when Bun runs a file with a `default` export containing a `fetch` handler, it passes it into `Bun.serve` under the hood. +Instead of passing the server options into `Bun.serve`, `export default` it. This file can be executed as-is; when Bun sees a file with a `default` export containing a `fetch` handler, it passes it into `Bun.serve` under the hood. -This syntax has one major advantage: it is hot-reloadable out of the box. When any source file is changed, Bun will reload the server with the updated code _without restarting the process_. This makes hot reloads nearly instantaneous. Use the `--hot` flag when starting the server to enable hot reloading. +<!-- This syntax has one major advantage: it is hot-reloadable out of the box. When any source file is changed, Bun will reload the server with the updated code _without restarting the process_. This makes hot reloads nearly instantaneous. Use the `--hot` flag when starting the server to enable hot reloading. --> -```bash +<!-- ```bash $ bun --hot server.ts -``` +``` --> -It's possible to configure hot reloading while using the explicit `Bun.serve` API; for details refer to [Runtime > Hot reloading](/docs/runtime/hot). +<!-- It's possible to configure hot reloading while using the explicit `Bun.serve` API; for details refer to [Runtime > Hot reloading](/docs/runtime/hot). --> ## Streaming files |