1.0.2 • Published 11 months ago

nest-request-id v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

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