O'Reilly logo

Node.js 6.x Blueprints by Fernando Monteiro

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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/', ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required