Configuring the app.js file

We will, step by step, make the app.js file; it will have many similar parts to the application created in Chapter 01. However, in this chapter we will be using different modules and a different way to create the application controls.

In, Node.js with the Express framework, there are different ways to accomplish the same goals:

  1. Open the app.js file at the root project folder and add the following modules:
     // Import basic modules var express = require('express'); var path = require('path'); var favicon = require('serve-favicon'); var logger = require('morgan'); var cookieParser = require('cookie-parser'); var bodyParser = require('body-parser'); // import multer var multer = require('multer'); var upload = multer({ dest:'./public/uploads/', ...

Get Node.js 6.x Blueprints now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.