@nest-middleware-collection/morgan
v9.0.0
Published
NestJS Middleware for Morgan
Downloads
1
Maintainers
Readme
Nest Middlewares - Morgan
This is the Nest Middleware wrapper around morgan.
Installation
@nest-middleware-collection/morgan
is available from NPM. You can install it with this command:
npm install --save @nest-middleware-collection/morgan
Usage
import { MorganMiddleware } from '@nest-middleware-collection/morgan';
@Module(...)
export class MyModule {
configure(consumer: MiddlewaresConsumer) {
// IMPORTANT! Call Middleware.configure BEFORE using it for routes
MorganMiddleware.configure( /* options as per morgan docs */ )
consumer.apply(MorganMiddleware).forRoutes( /* your routes */ );
}
}