@nest-middlewares/serve-static
TypeScript icon, indicating that this package has built-in type declarations

10.0.0 • Public • Published

Nest Middlewares - Serve Static

Coverage Status

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 */ );
    }
}

Dependencies (4)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @nest-middlewares/serve-static

    Weekly Downloads

    115

    Version

    10.0.0

    License

    MIT

    Unpacked Size

    5.54 kB

    Total Files

    6

    Last publish

    Collaborators

    • wbhob