Documentation
    Preparing search index...
    interface GatewayRouterOptions {
        onResolveMedia: (
            req: Request,
            uid: string,
            action: string,
        ) => Promise<MediaResolution | null>;
        secret?: string;
    }
    Index

    Properties

    onResolveMedia: (
        req: Request,
        uid: string,
        action: string,
    ) => Promise<MediaResolution | null>

    Callback to resolve the media location.

    Type Declaration

      • (req: Request, uid: string, action: string): Promise<MediaResolution | null>
      • Parameters

        • req: Request

          The Express request object, which contains original headers like 'x-user-token' if passed by Gateway.

        • uid: string

          The unique identifier of the media.

        • action: string

          The requested action (e.g., 'file', 'thumbnail').

        Returns Promise<MediaResolution | null>

        A promise resolving to the media resolution object.

    secret?: string

    The shared secret used to authenticate requests from the API Gateway. If not provided, it will log a warning and accept any request (not recommended for production).