-
Notifications
You must be signed in to change notification settings - Fork 36
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
add optional controller support #31
Conversation
Hi @marsprince , thank you for your contribution 😃. But i didn't get your idea of adding Can you clarify or maybe what is the main use cases here for that? 😃 |
Sorry, my English is poor. As I know, MODULE_PATH is only used by routes-resolver. Then nestjs will register router by modulePath + basePath. But in other places such as middleware, It find path by PATH_METADATA So if I use module path , It can't not find whole path(module path+method path), the path defined in MODULE_PATH can't be found. So the middleware's applied router is wrong. I'm a newer in nestjs and I don't know how to solve it , so I use an option to directly define controller. Thank you! |
Example In moduleA,I use It applied in router /c not /a/c |
Thank you @marsprince 🙂 , I will review that PR and will inform you what i think. |
Hi @marsprince , I really appreciate your hard work. Thank you again for that 👍 |
Sometime we need directly define controller's path because not all path finder in nestjs equal
to module path + controller path.
For example, in Middleware
consumer.apply(someMiddleware).forRoutes(SomeController);
it only find PATH_METADATA, not MODULE_PATH.
The change in PR also make us lose ability to define own route in Decorator @controller,but I think it is not important. Decorator route in controller class is not necessary with nested routes.