Skip to content

Instantly share code, notes, and snippets.

@LazyFatArrow
Created August 19, 2019 11:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LazyFatArrow/8eabe3d4519dff7606f9c6faaafd8158 to your computer and use it in GitHub Desktop.
Save LazyFatArrow/8eabe3d4519dff7606f9c6faaafd8158 to your computer and use it in GitHub Desktop.
// ...imports
import { MiddlewareConsumer, Module, NestModule, RequestMethod } from '@nestjs/common';
import { ServeHTMLMiddleware } from './app.middleware';
@Module({
// ...module options
})
export class AppModule implements NestModule {
configure(consumer: MiddlewareConsumer) {
consumer
.apply(ServeHTMLMiddleware)
.forRoutes({ path: '*', method: RequestMethod.GET});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment