Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// ...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
You can’t perform that action at this time.