brisa-build / brisa

The Web Platform Framework.
https://brisa.build
MIT License
452 stars 12 forks source link

feat: add idleTimeout #566

Closed aralroca closed 1 month ago

aralroca commented 1 month ago

Fixes https://github.com/brisa-build/brisa/issues/565

Idle Timeout

The idleTimeout is the maximum amount of time a connection is allowed to be idle before the server closes it. A connection is idling if there is no data sent or received.

Default: 30 seconds.

Example

In the next example, we are setting the idleTimeout to 10 seconds.

brisa.config.ts:

import type { Configuration } from "brisa";

export default {
  idleTimeout: 10,
} satisfies Configuration;

Types

export type Configuration = {
  // ...
  idleTimeout?: number;
};

[!NOTE]

This idleTimeout is working in Bun and Node.js runtimes.