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