Mstop
Bun

method

Server.stop

closeActiveConnections?: boolean
): Promise<void>;

Stop listening to prevent new connections from being accepted.

By default, it does not cancel in-flight requests or websockets. That means it may take some time before all network activity stops.

@param closeActiveConnections

Immediately terminate in-flight requests, websockets, and stop accepting new connections.