You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,6 +125,19 @@ serve({
125
125
})
126
126
```
127
127
128
+
### `autoCleanupIncoming`
129
+
130
+
The default value is `true`. The Node.js Adapter automatically cleans up (explicitly call `destroy()` method) if application is not finished to consume the incoming request. If you don't want to do that, set `false`.
131
+
132
+
If the application accepts connections from arbitrary clients, this cleanup must be done otherwise incomplete requests from clients may cause the application to stop responding. If your application only accepts connections from trusted clients, such as in a reverse proxy environment and there is no process that returns a response without reading the body of the POST request all the way through, you can improve performance by setting it to `false`.
133
+
134
+
```ts
135
+
serve({
136
+
fetch: app.fetch,
137
+
autoCleanupIncoming: false,
138
+
})
139
+
```
140
+
128
141
## Middleware
129
142
130
143
Most built-in middleware also works with Node.js.
@@ -155,7 +168,7 @@ import { serveStatic } from '@hono/node-server/serve-static'
155
168
app.use('/static/*', serveStatic({ root: './' }))
156
169
```
157
170
158
-
Note that `root`must be _relative_ to the current working directory from which the app was started. Absolute paths are not supported.
171
+
If using a relative path, `root`will be relative to the current working directory from which the app was started.
159
172
160
173
This can cause confusion when running your application locally.
0 commit comments