NestJS - Interceptors
You want to create a LoggingInterceptor that logs the request method, URL, and the time taken for each request. Which code snippet correctly implements this behavior?
context.switchToHttp().getRequest() to get the HTTP request object in NestJS interceptors.tap operator is used to perform logging without altering the response stream. Using map or console.error is incorrect here.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions