New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
route exclusion from the setGlobalPrefix not taken in account when enableVersioning is set #10215
Comments
I think the expected route should be http://localhost:3000/v1/route because |
one request then is to be able to exclude the same route from the versioning as well |
Try adding
to the controller method. |
When I add It would be great just to have the possibility to exclude a specific route (or a list) from all the global route prefixes. |
@cperuzzi I think you have added the version_neutral at the controller level, you need to add it to the function level only. |
This is not working for me as well. |
My excluded routes are completely hosed right now when version is bumped from 9.2.1 to latest. We have a similar setup to OP. |
Let's track this here #11650 |
Is there an existing issue for this?
Current behavior
Hi folks,
When you create an API and set the global prefix to something with a configuration containing exclusion like this
app.setGlobalPrefix('api', { exclude: [ "/my-route", ], });
the 'my-route' is not taken in account at all if I enable the API versioning like this :
app.enableVersioning({ type: VersioningType.URI, defaultVersion: '1', });
Minimum reproduction code
https://github.com/cperuzzi/nest-routing-issue
Steps to reproduce
Expected behavior
when a route is excluded in the global prefix it should be excluded even if the route versioning is enabled
Package
@nestjs/common
@nestjs/core
@nestjs/microservices
@nestjs/platform-express
@nestjs/platform-fastify
@nestjs/platform-socket.io
@nestjs/platform-ws
@nestjs/testing
@nestjs/websockets
Other package
No response
NestJS version
9.x
Packages versions
Node.js version
16.17.0
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: