-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
MEAN Web Development - Second Edition
By :
The Express framework is pattern-agnostic, which means that it doesn't support any predefined syntax or structure, as some other web frameworks do. Applying the MVC pattern to your Express application means that you can create specific folders where you place your JavaScript files in a certain logical order. All these files are basically CommonJS modules that function as logical units. For instance, models will be CommonJS modules that contain a definition of Mongoose models placed in the models folder, views will be HTML or other template files placed in the views folder, and controllers will be CommonJS modules with functional methods placed in the controllers folder. To illustrate this better, it's time to discuss the different types of application structure.
We previously discussed better practices when developing a real application, where we recommended the use of the package.json file over directly installing your...