Playing with Node.js, and I really want my file structure to be organized. Usually in a project in another language I would have this structure:
- Node Application Catalog
- App.js
- Controllers
- UserController.js
- OtherController.js
- Models
- UserModel.js
- OtherModel.js
The problem (potential) that I see is this: I use Mongoose and MongoDB for my database to define a "model". I need a Mongoose schema to do this, I have to connect to the database using Mongoose in each of the controller files and models.
I know so little about these technologies, it can be lightning fast and will never be a problem, and I would have no idea. Or is this something I should avoid and just put everything in one (very large) file?
source share