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

/nest-request-id/

    Package Sidebar

    Install

    npm i nest-request-id

    Weekly Downloads

    4

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    88.1 kB

    Total Files

    13

    Last publish

    Collaborators

    • ivasiljevic