sveltekit-service-manager
    Preparing search index...

    Type Alias HandlerConfig

    HandlerConfig: {
        allowedHosts?: readonly string[];
        locals?: (event: RequestEvent) => App.Locals | Record<string, any>;
        origin?: string | URL;
        platform?: (event: RequestEvent) => App.Platform | Record<string, any>;
    } & (
        | {
            request: (event: RequestEvent) => Promise<Response> | Response;
            router?: never;
        }
        | { request?: never; router: ServiceRouter }
    )

    Handler configuration:

    • Provide router to route requests with a ServiceRouter
    • Or provide request to handle requests directly

    Optionally provide locals and platform factories to mimic SvelteKit event behavior.

    Type Declaration

    • OptionalallowedHosts?: readonly string[]

      Allow only these Host header values. Entries may include a port.

    • Optionallocals?: (event: RequestEvent) => App.Locals | Record<string, any>
    • Optionalorigin?: string | URL

      Pin event.url to a trusted origin instead of deriving it from the Host header.

    • Optionalplatform?: (event: RequestEvent) => App.Platform | Record<string, any>
    • {
          request: (event: RequestEvent) => Promise<Response> | Response;
          router?: never;
      }
    • { request?: never; router: ServiceRouter }