Represents the options for the middleware.

interface MiddlewareOptions {
    customEnvNames?: string[];
    customHeaderKeys?: string[];
    dataFormat?: ((data: any, isFromResponse: boolean, req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>) => any);
    genId?: GenerateId;
    logger?: SimpleLogger;
    onReqFinished?: OnReqFinished;
    stdoutDisabled?: boolean;
}

Properties

customEnvNames?: string[]

An array of custom environment variable names.

customHeaderKeys?: string[]

An array of custom header keys.

dataFormat?: ((data: any, isFromResponse: boolean, req: Request<ParamsDictionary, any, any, ParsedQs, Record<string, any>>) => any)

A function that formats the data before logging.

genId?: GenerateId

A function that generates an ID.

logger?: SimpleLogger

An instance of a logger.

onReqFinished?: OnReqFinished

Callback function that will be called when the request is finished.

stdoutDisabled?: boolean

Specifies whether the standard output is disabled.