I would like to know how do you usually organize your application structure when building a NodeJS application using nvst. When I create my app it automatically build up this structure for me:
So, the first thing that came to my mind was, where should I put my controllers and how do I connect them with the routes and views?
Also, how can I organize my unit testing logic?
An NTVS angular app is still just an angular app. The advice in AngularJS application file structure applies.
Going further, General principle: You should be able to find what you're looking for without excessive drilling or scrolling.
Schemes:
I lean toward folder by function, as it keeps files that may need to be modified at the same time together.
As for unit tests, I have seen either
myfile.test.js
ormyfile.spec.js
sitting right besidemyfile.js
. If you do not include the test files in the index.js, then they won't be loaded and don't cause a problem.