nest-request-id

1.0.2 • Public • Published

npm npm version License

nest-request-id

RequestID middleware for Nest.js that adds an indentifier to the request and response.

Installation

Run npm i nest-request-id

Example

import { Module, NestModule, MiddlewareConsumer } from '@nestjs/common';
import { RequestIdMiddleware } from 'nest-request-id';
import { CatsModule } from './cats/cats.module';

@Module({
imports: [CatsModule],
})
export class AppModule implements NestModule {
    configure(consumer: MiddlewareConsumer) {
        consumer
            .apply(RequestIdMiddleware)
            .forRoutes('cats');
    }
}

License

MIT License © Ivan Vasiljevic

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    5
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    5
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i nest-request-id

Weekly Downloads

5

Version

1.0.2

License

MIT

Unpacked Size

88.1 kB

Total Files

13

Last publish

Collaborators

  • ivasiljevic