Skip to content
This repository has been archived by the owner on Jul 8, 2021. It is now read-only.

Commit

Permalink
fix: upgraded to nestjs v6
Browse files Browse the repository at this point in the history
BREAKING CHANGE: not compatible with nestjs v5 and bellow

fix #1
  • Loading branch information
mentos1386 committed Apr 5, 2019
1 parent bf9289c commit ceba8f5
Show file tree
Hide file tree
Showing 5 changed files with 4,051 additions and 4,336 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ This's a [Morgan](https://github.com/expressjs/morgan) module for [Nest](https:/
$ npm i --save nest-morgan morgan @types/morgan
```

### Versions
* **1.x** Is for Nest v6.x
* **0.x** Is for Nest v5.x

## Quick Start


Expand Down
5 changes: 3 additions & 2 deletions lib/morgan.interceptor.abstract.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
ExecutionContext, Inject, Injectable,
NestInterceptor,
CallHandler,
} from '@nestjs/common';
import { Observable } from 'rxjs/Observable';
import * as morgan from 'morgan';
Expand All @@ -19,7 +20,7 @@ export abstract class AbstractMorganInterceptor implements NestInterceptor {

intercept(
context: ExecutionContext,
call$: Observable<any>,
next: CallHandler<any>,
): Observable<any> {
const httpRequest = context.switchToHttp().getRequest();
const httpResponse = context.switchToHttp().getResponse();
Expand All @@ -31,7 +32,7 @@ export abstract class AbstractMorganInterceptor implements NestInterceptor {
this.morganInstance(this.format, this.options)(httpRequest, httpResponse, console.error)
}

return call$;
return next.handle();
}

}
Loading

0 comments on commit ceba8f5

Please sign in to comment.