[ ] Regression
[x] Bug report
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.
in the .module - consumer.apply([middlewares]).forRoutes('get/stuff');
At the moment, the middlewares don't get invoked when we pass a single route as a string, it only works with a controller.. So we are unable to configure middlewares for a certain route..
The middlewares should be called before the controller.
Hey @bojidaryovchev,
Thanks for reporting, I'll take a look at it 馃憤
Fixed in v5.0.1
@kamilmysliwiec I'm seeing this issue again in v5.7.4
. Middleware is invoked with a controller is passed but not when a string is passed.
This works:
export class AppModule implements NestModule {
configure(consumer: MiddlewareConsumer) {
consumer.apply(LoggerMiddleware).forRoutes(MyController);
}
}
But this doesn't:
export class AppModule implements NestModule {
configure(consumer: MiddlewareConsumer) {
consumer.apply(LoggerMiddleware).forRoutes('*');
}
}
@felangel could you please create a separate issue? :)
@kamilmysliwiec thanks for the quick reply! I saw the issue was fixed in the latest release 馃憤馃帀馃挴
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Hey @bojidaryovchev,
Thanks for reporting, I'll take a look at it 馃憤