Consuming a microservice
In this recipe, we will create an Express.js web application that will consume the loopback-bookstore
microservice created in the previous recipe, Generating a microservice with LoopBack. This will demonstrate how modern web architectures are implemented based on the microservice pattern.
Getting ready
In this recipe, we will be consuming the microservice created in the Generating a microservice with LoopBack recipe. If you have not completed that recipe, you can obtain the code from the Packt GitHub repository at https://github.com/PacktPublishing/Node.js-Cookbook-Fifth-Edition in the Chapter11/loopback-bookstore
directory.
We will also be creating a frontend web application, using the Express.js generator to create a base for our web application. For more information on the Express.js generator, visit https://expressjs.com/en/starter/generator.html.
Enter the following commands in your terminal to create the base application using the Express...