Search code examples
angularnestjsnpxnx-workspace

Creating NestJS Controllers and Modules in a NX Workspace


I am using the NX workspace's angular-nest boilerplate to get started with an App. Whenever I try to use the CLI or the NX extension to generate a controller/module etc, it gets placed in the wrong folder.

https://i.sstatic.net/RBR2n.png

For instance, if I generate a new module for nest, I would like it to be placed in api/src as that is where the Nest files are. But in my case if I use the command nest generate module helloworld, it gets placed in the src/helloworld folder outside of the api/src folder.

Is there a simpler way to make it so that my Nest components and modules etc are generated in the Nest folder and Angular components etc are in the Angular folder?


Solution

  • use the "NX console" extension ( which I see you already installed... ) enter image description here replace "data-store-api" with the name of the nest js project name