aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--types/bun/bun.d.ts16
1 files changed, 16 insertions, 0 deletions
diff --git a/types/bun/bun.d.ts b/types/bun/bun.d.ts
index 4a1ddc518..da4aa796e 100644
--- a/types/bun/bun.d.ts
+++ b/types/bun/bun.d.ts
@@ -562,6 +562,22 @@ declare module "bun" {
serverNames: Record<string, SSLOptions & SSLAdvancedOptions>;
};
+ /**
+ * HTTP & HTTPS Server
+ *
+ * To start the server, see {@link serve}
+ *
+ * Often, you don't need to interact with this object directly. It exists to help you with the following tasks:
+ * - Stop the server
+ * - How many requests are currently being handled?
+ *
+ * For performance, Bun pre-allocates most of the data for 2048 concurrent requests.
+ * That means starting a new server allocates about 500 KB of memory. Try to
+ * avoid starting and stopping the server often (unless it's a new instance of bun).
+ *
+ * Powered by a fork of [uWebSockets](https://github.com/uNetworking/uWebSockets). Thank you @alexhultman.
+ *
+ */
interface Server {
/**
* Stop listening to prevent new connections from being accepted.