[]previous and next page

BunServeHandle

A running native server. (BunServeHandle of @shadow-js/dusk/bun)

A running native server.

Import#

ts
import type { BunServeHandle } from "@shadow-js/dusk/bun";

Signature#

ts
interface NativeServeHandle {
  readonly port: number;
  readonly hostname: string;
  /** `http://host:port`. */
  readonly url: string;
  /** True once a stop has started: new requests are refused. */
  readonly draining: boolean;
  /** Stops accepting connections and waits for requests in flight, up to `gracefulShutdownMs`. Idempotent. */
  close(): Promise<void>;
}

Members#

Name Type Description
port readonly port: number
hostname readonly hostname: string
url readonly url: string http://host:port.
draining readonly draining: boolean True once a stop has started: new requests are refused.
close close(): Promise<void> Stops accepting connections and waits for requests in flight, up to gracefulShutdownMs. Idempotent.