One primary goal of this book is to set up a GraphQL API, which is then consumed by our React front end. To accept network requests (especially GraphQL requests), we are going to set up a Node.js web server.
The most significant competitors in the Node.js web server area are Express.js, Koa, and Hapi. In this book, we are going to use Express.js. Most tutorials and articles about Apollo rely on it.
Express.js is also the most used Node.js web server out there and explains itself as a Node.js web framework, offering all the main features needed to build web applications.
Installing Express.js is pretty easy. We can use npm in the same way as in the first chapter:
npm install --save express
This command adds the latest version of Express to package.json.
In the first chapter, we created all JavaScript files directly in the src/client folder. Now, let&apos...