@nest-middlewares/compression
v10.0.0
Published
NestJS Middleware for Compression
Downloads
4,213
Readme
Nest Middlewares - Compression
This is the Nest Middleware wrapper around compression.
Installation
@nest-middlewares/compression
is available from NPM. You can install it with this command:
npm install --save @nest-middlewares/compression
Usage
import { CompressionMiddleware } from '@nest-middlewares/compression';
@Module(...)
export class MyModule {
configure(consumer: MiddlewaresConsumer) {
// IMPORTANT! Call Middleware.configure BEFORE using it for routes
HelmetMiddleware.configure( /* options as per helmet docs */ )
consumer.apply(CompressionMiddleware).forRoutes( /* your routes */ );
}
}