From 108678f70cd3f5f7667e5093a244970b86669572 Mon Sep 17 00:00:00 2001 From: Yusuke Wada Date: Fri, 12 Apr 2024 07:43:19 +0900 Subject: [PATCH] docs(readme): update (#157) --- README.md | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6b3377f..740700e 100644 --- a/README.md +++ b/README.md @@ -48,15 +48,15 @@ Essentially, you can simply use the latest version of each major release. ## Installation -You can install from npm registry with `npm` command: +You can install it from the npm registry with `npm` command: -``` +```sh npm install @hono/node-server ``` Or use `yarn`: -``` +```sh yarn add @hono/node-server ``` @@ -79,7 +79,7 @@ serve(app, (info) => { For example, run it using `ts-node`. Then an HTTP server will be launched. The default port is `3000`. -``` +```sh ts-node ./index.ts ``` @@ -114,6 +114,17 @@ serve({ }) ``` +### `overrideGlobalObjects` + +The default value is `true`. The Node.js Adapter rewrites the global Request/Response and uses a lightweight Request/Response to improve performance. If you don't want to do that, set `false`. + +```ts +serve({ + fetch: app.fetch, + overrideGlobalObjects: false, +}) +``` + ## Middleware Most built-in middleware also works with Node.js.