Introducing Express.js
Express.js is a minimalist server-side web framework for Node.js. It is built on top of Node.js to make it easy to manage the Node.js server. The most important strength of Express.js is that it makes the routing very, very easy. The robust API that it provides is very easy to configure. It is easy to receive requests from the frontend and easy to connect to the database. Express.js is also the most popular web framework for Node.js. It uses the Model View Controller (MVC) design pattern, which we will be discussing later on in this chapter.
Installing Express.js
We have already covered how to install node
modules via npm
. Similarly, we can install Express.js via NPM using this command:
$ npm install express
This is an easy way to install node
modules. But, while building an application, we're going to need lots of different kinds of modules. We will also want to share these modules across our multiple applications. Hence, to make a module available globally, we will...