aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-04-13 05:07:33 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-04-13 05:07:33 -0700
commitd273948f168fdb939f21622f2837c832d9ef4934 (patch)
tree30bcf3a2d313891d7a3b85893ed108488d7d4b6e
parentbb79687f8ed869086c02183a5bbb699aef855969 (diff)
downloadbun-d273948f168fdb939f21622f2837c832d9ef4934.tar.gz
bun-d273948f168fdb939f21622f2837c832d9ef4934.tar.zst
bun-d273948f168fdb939f21622f2837c832d9ef4934.zip
Update bun.d.ts
-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.