sveltekit-service-manager - v1.1.0
    Preparing search index...

    Class WebHTTPServer<TServerConfig>

    A minimal HTTP/HTTPS server that adapts Node's IncomingMessage/ServerResponse to a Fetch API Request/Response and a SvelteKit-like RequestEvent.

    Key properties:

    • Supports streaming request bodies (Readable.toWeb)
    • Supports streaming response bodies (pipeTo with fallback)
    • Collects set-cookie calls made via event.cookies
    • Can dispatch via ServiceRouter or a custom request handler

    Type Parameters

    Index

    Constructors

    Accessors

    Methods

    • Start listening.

      Parameters

      • ...args: [handle: any, listeningListener?: () => void]

      Returns this

    • Create a SvelteKit-like RequestEvent for handlers.

      This is intentionally minimal, but:

      • supports cookies
      • supports setHeaders
      • supports locals/platform factories
      • provides fetch, url, request, getClientAddress

      Parameters

      • request: Request
      • utils: {
            getClientAddress: () => string;
            handlers?: {
                locals?: (event: RequestEvent) => Locals;
                platform?: (event: RequestEvent) => Platform;
            };
            pushSetCookie: (value: string) => void;
            setHeader: (name: string, value: string) => void;
        }

      Returns RequestEvent<{}, null>