Here, you will modify your code to use Cosmos DB to dynamically query data. You will remove the constant variable quotes that contain the author quotes.
- Open Command Prompt and go to the directory where the server.js file is.
- Type npm install documentdb --save. This will install the Cosmos DB component that you can use in the Node.js code to access Cosmos DB and query data. Also --save will save documentdb as dependencies in package.json.
- Open server.js in Visual Studio Code.
- Declare the Cosmos DB client using var documentClient = require('documentdb').DocumentClient.
- Declare the Cosmos DB endpoint and primary key to create a Cosmos DB client: var dbClient = new documentClient(endpoint, { "masterKey": ...