@trxn/nestjs-request-timestamp
v3.0.0
Published
Provides a middleware to add timestamp of the request in the response object.
Downloads
110
Readme
Nestjs - Request timestamp
Provides a middleware to add timestamp of the request in the response object.
res.locals.timestamp = Date.now();
To retrieve this value:
@Injectable({ scope: Scope.REQUEST })
export class SentryPerRequestLogger extends SentryLogger {
constructor(
@Inject(REQUEST)
protected readonly request: Request,
) {
super();
const timestamp = this.request.res.locals.timestamp;
}
}