RenderGatewayOptions: {
    authentication?: AuthenticationOptions;
    cloudOptions?: ServerOptions["integrations"];
    defaultRenderErrorResponse?: string;
    host: string;
    keepAliveTimeout?: number;
    name: string;
    port: number;
    renderEnvironment: IRenderEnvironment;
    uncaughtRenderErrorHandler?: CustomErrorHandlerFn;
}

Options for configuring the gateway.

Type declaration

  • Optional Readonlyauthentication?: AuthenticationOptions

    Options to indicate how to authenticate incoming render requests.

  • Optional ReadonlycloudOptions?: ServerOptions["integrations"]

    Specify which cloud facilities we want.

  • Optional ReadonlydefaultRenderErrorResponse?: string

    A string that will be used to build an error response for a failed render if all other error handling options fail.

    If the sequence ${error} appears in the string, it will be replaced with the JSONified error information. If it does not appear, the JSONified error information will be omitted (useful if you don't want to include that for users).

  • Readonlyhost: string

    The hostname to which the gateway service should bind.

  • Optional ReadonlykeepAliveTimeout?: number

    Optional value in milliseconds for keepalive timeout of the server. For running in Google Cloud, this should be higher than the load balancer's own keepalive timeout value, which at time of writing was indicated to be 80000ms [1].

    [1] https://khanacademy.slack.com/archives/CJSE4TMQX/p1573252787333500

    Defaults to 90000.

  • Readonlyname: string

    The name of the gateway service.

  • Readonlyport: number

    The port on which the gateway service will listen.

  • ReadonlyrenderEnvironment: IRenderEnvironment

    The environment that will handle rendering.

  • Optional ReadonlyuncaughtRenderErrorHandler?: CustomErrorHandlerFn

    Handler that will be invoked if a render request causes an exception.

    This provides the running server with an opportunity to override the default uncaught error response and provide a more friendly message.