Skip to main content

Class: NestLensModule

Defined in: nestlens.module.ts:185

Implements​

  • NestModule
  • OnModuleInit

Constructors​

Constructor​

new NestLensModule(config): NestLensModule

Defined in: nestlens.module.ts:186

Parameters​

config​

NestLensConfig

Returns​

NestLensModule

Methods​

configure()​

configure(consumer): void

Defined in: nestlens.module.ts:204

Opens a request context around every request.

Middleware rather than an interceptor: it calls into the rest of the request synchronously, so a query or cache read recorded deep inside the handler still knows which request it belongs to. See request-context.ts.

Not applied when NestLens is switched off. forRoot returns an empty module for enabled: false, but this hook belongs to the class rather than to what forRoot returned, so it ran anyway: a uuid and an AsyncLocalStorage.run on every request of an application that had turned the library off, plus a property written onto every request object.

Parameters​

consumer​

MiddlewareConsumer

Returns​

void

Implementation of​

NestModule.configure


onModuleInit()​

onModuleInit(): Promise<void>

Defined in: nestlens.module.ts:465

Returns​

Promise<void>

Implementation of​

OnModuleInit.onModuleInit


forRoot()​

static forRoot(config): DynamicModule

Defined in: nestlens.module.ts:217

Parameters​

config​

NestLensConfig = {}

Returns​

DynamicModule