In this collection of recipes, we will create a simple HTTP server using Node and a popular web application called express. Express is a Node package used to create small web applications. It provides support to map HTTP verbs to URL paths, which makes it ideal to set up a quick HTTP server to host an API.
In this section, we will look at managing our application's dependencies as well as building a simple HTTP server and a web API using express.
Nearly all but the extremely simple applications will require one or more external dependencies. Typically, these are NPM modules. In this section, we will look at using a package configuration file. This allows us to configure or project and manage dependencies.
We can create a package.json
file by using NPM. Enter the following command in your terminal or command window:
npm init