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. Idle keep-alive connections are closed right away, and connections with a request in flight close as soon as their response completes. That means it may take some time before all network activity stops.

The returned promise resolves once every connection is closed.

@param closeActiveConnections

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