The complete code for the backend server is available in CH07/server. In this chapter, we are going to understand how the REST API can be built. Start with an empty folder and follow these steps:
- Initiate the project with yarn init or by creating a package.json file. We are already familiar with the process of adding and removing any npm packages from the project. Simply copy the package.json file from CH08 into your new project folder.
- Create a folder called server where we can place all our backend logic. We are going to use the express framework to create backend. Inside the server folder, create a file called index.js. Inside the file, we initiate the express server with the required parameter, as follows:
/* eslint ...