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
Large applications can have dozens of controllers. Placing them all at the root of the controllers/ directory is not possible in this case and we need to create subdirectories.
Unfortunately the current version of generate controller only generates controllers at the root of controllers/. In addition, the --register option only allows the controllers to be registered in app.controller.ts.
Possible solution
Let the command accept sub-directories (and create them if they do not exist already) and make the --register flag accept an optional parameter specifying the parent where to register the controller.
Issue
Large applications can have dozens of controllers. Placing them all at the root of the
controllers/
directory is not possible in this case and we need to create subdirectories.Unfortunately the current version of
generate controller
only generates controllers at the root ofcontrollers/
. In addition, the--register
option only allows the controllers to be registered inapp.controller.ts
.Possible solution
Let the command accept sub-directories (and create them if they do not exist already) and make the
--register
flag accept an optional parameter specifying the parent where to register the controller.Example
File Structure (before)
api.controller.ts (before)
Command
File Structure (after)
api.controller.ts (after)
The text was updated successfully, but these errors were encountered: