You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is most likely an issue with Nest itself than with this library. Maybe also related to this: #92 ?
The library is only mounting the middleware to * by default and then Nest does with it what it wants.
What you can do to try and fix it on your end is mount the middleware manually for specific routes.
However, I'd like to speak from experiance and say that I never had a good time with setting things globally and then excluding some of the things. It makes for less readable code, because you have to always check if that particular thing is excluded or not and you're not always sure where to look for this information.
So I now never use global prefix (unless it is api and there are no exceptions) and instead just either repeat it in on the top of each controller (while re-using a constant, of course - e.g. Controller(`${GLOBAL_PATH}`/users). This gives you the possibility to explicitly opt-out of the global prefix while keeping the information localized where it is used, instead of hiding it in some configuration file somewhere else. Another alternative is using the RouterModule to create a hieararchy of controllers - which is what I would probably advise in your situation so you don't have to change your controllers.
Hi,
I hit weird issue with this great library.
I have a global prefix on my service declared like this:
The issue is about the middleware not working for paths excluded from global prefix.
No idea why to be honest.
The text was updated successfully, but these errors were encountered: