@pas7/nestjs-request-context-adapter-fastify
v0.3.8
Published
Fastify adapter for NestJS request context
Downloads
383
Readme
@pas7/nestjs-request-context-adapter-fastify
Fastify adapter for @pas7/nestjs-request-context.
When to use
Use this package when your NestJS app runs on @nestjs/platform-fastify.
Installation
pnpm add @pas7/nestjs-request-context @pas7/nestjs-request-context-adapter-fastifyQuick example
import { MiddlewareConsumer, Module } from '@nestjs/common';
import { requestContextMiddleware } from '@pas7/nestjs-request-context-adapter-fastify';
@Module({})
export class AppModule {
configure(consumer: MiddlewareConsumer) {
consumer.apply(requestContextMiddleware()).forRoutes('*');
}
}Options
interface RequestContextFastifyOptions {
header?: string;
idGenerator?: () => string;
addResponseHeader?: boolean;
}Exports
requestContextMiddlewarerequestContextPluginUseRequestContextFastifyDEFAULT_FASTIFY_OPTIONSRequestContextFastifyOptions
Related
- Root docs:
README.md - Changelog:
CHANGELOG.md - Main package:
@pas7/nestjs-request-context
About
Developed by PAS7 - https://pas7.com.ua/
- 📖 Article: NestJS Request Context with ALS
- 📧 Contact: https://pas7.com.ua/contact
License
Apache-2.0
