MCPcopy
hub / github.com/nestjs/nest / Middleware

Class Middleware

integration/hello-world/e2e/middleware-fastify.spec.ts:376–385  ·  integration/hello-world/e2e/middleware-fastify.spec.ts::Middleware

Source from the content-addressed store, hash-verified

374
375 describe(class="st">'should execute middleware only once for given routes', () => {
376 class Middleware implements NestMiddleware {
377 use(request: any, reply: any, next: () => void) {
378 if (request.middlewareExecutionCount === undefined) {
379 request.middlewareExecutionCount = 1;
380 } else {
381 request.middlewareExecutionCount++;
382 }
383 next();
384 }
385 }
386
387 @Controller()
388 class AbcController {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected