Skip to content

Commit

Permalink
don't log root
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhender committed Oct 13, 2023
1 parent dbe4a48 commit 79b2446
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/vc-api/src/morgan.middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ import { morganFormat } from './logging.config';
@Injectable()
export class MorganMiddleware implements NestMiddleware {
use(req: any, res: any, next: () => void) {
morgan(morganFormat)(req, res, next);
if (req.baseUrl !== '' && req.baseUrl !== '/') {
morgan(morganFormat)(req, res, next);
} else {
next();
}
}
}

0 comments on commit 79b2446

Please sign in to comment.