Setu-TS
    Preparing search index...

    Interface DenoServeHost

    Minimal interface covering the Deno operations this adapter needs. Inject this interface to test the adapter without real Deno.

    interface DenoServeHost {
        serve(
            options: {
                fetch: (
                    request: Request,
                    info?: { remoteAddr?: { hostname?: string } },
                ) => Response | Promise<Response>;
                hostname?: string;
                onListen?: (address: { hostname: string; port: number }) => void;
                port: number;
            },
        ): DenoServer;
        upgradeWebSocket?(
            request: Request,
            options?: { protocol?: string },
        ): DenoWebSocketUpgrade;
    }
    Index
    • Starts an HTTP server.

      Parameters

      • options: {
            fetch: (
                request: Request,
                info?: { remoteAddr?: { hostname?: string } },
            ) => Response | Promise<Response>;
            hostname?: string;
            onListen?: (address: { hostname: string; port: number }) => void;
            port: number;
        }

        Server options

        • fetch: (
              request: Request,
              info?: { remoteAddr?: { hostname?: string } },
          ) => Response | Promise<Response>
        • Optionalhostname?: string
        • OptionalonListen?: (address: { hostname: string; port: number }) => void

          Replaces Deno.serve's own startup banner. Supplied by the local diagnostics listener so its line names the devtool rather than reading as a second, unexplained application listener; omitted by the application adapter, which keeps the default banner.

        • port: number

      Returns DenoServer

      The Deno HTTP server

    • Performs an RFC 6455 handshake on an inbound request.

      Optional so that a host injected before this seam existed still satisfies the interface; when absent, the adapter refuses upgrades with 501.

      Parameters

      • request: Request

        The native, undisturbed upgrade request

      • Optionaloptions: { protocol?: string }

        Handshake options; protocol echoes a negotiated subprotocol

      Returns DenoWebSocketUpgrade

      The server-side socket and the 101 response to return