List of Listings

 

Chapter 3. Creating and setting up a MEAN project

Listing 3.1. Example package.json file in a new Express project

Listing 3.2. Taking the controller code out of the route: step 1

Listing 3.3. Setting up the homepage controller in app_server/controllers/main.js

Listing 3.4. Updating the routes file to use external controllers

Listing 3.5. The complete index.jade file

Listing 3.6. Default layout.jade file

Listing 3.7. Updated layout.jade including Bootstrap references

Listing 3.8. Adding an engines section to package.json

Chapter 4. Building a static site with Node and Express

Listing 4.1. Requiring the controller files in routes/index.js

Listing 4.2. Defining the routes and mapping them to controllers

Listing 4.3. Others controller file

Listing 4.4. Locations controller file

Listing 4.5. Final code for the layout framework in app_server/views/layout.jade

Listing 4.6. Complete template for app_server/views/locations-list.jade

Listing 4.7. View for the Details page, app_server/views/location-info.js

Listing 4.8. View for the Add Review page, app_server/views/location-review.form.js

Listing 4.9. View for text only pages, app_server/views/generic-text.jade

Listing 4.10. The homelist controller, passing hard-coded data to the view

Listing 4.11. Final view for the homepage, app_server/views/locations-list.jade

Chapter 5. Building a data model with MongoDB and Mongoose