Parameters
-
config: ValueObject<{
environment: (() => "test" | "development" | "production");
fullDevLogs: (() => boolean);
healthEndpointPort: (() => number);
isDev: (() => boolean);
isProd: (() => boolean);
logLevel: (() => "" | "FATAL" | "ERROR" | "WARN" | "INFO" | "DEBUG" | "TRACE");
logMaskKeywords: (() => string[]);
logMaskMaxDepth: (() => number);
secureLoggingMode: (() => MaskMode);
serviceId: (() => string);
}>
Returns RequestHandler<ParamsDictionary, any, any, ParsedQs, Record<string, any>>
A RequestHandler middleware
This factory will generate a RequestHandler middleware with support for the following commands:
env
: output the current process.env variables of the service.config
: output the current Config structure of the service.getHeapStatistics
: output an object with heap statistics for the service.getHeapSnapshot
: generate a heap-snapshot for the service and download the file. the service will hang for some seconds when the snapshot is being generated.killService
: abruptly kill the service process, potentially followed-up with a restart of the process if service health is being monitored (i.e. production services).