Run GraphQL queries with NodeJS and express. The openAPI used for the project: https://developer.haloapi.com
-
Get a API key from HaloAPI.
-
Replace the below {{ your-api-key }} with your api key in the keys file:
module.exports.config = { halo: { desc: 'ocp-apim-subscription-key', key: '{{ your-api-key }}' } }
-
Open up a terminal and use command:
npm i
-
Once the packages are installed run the following command to start the express server:
npm start
-
Then run the below and it will return a queried object in the terminal and write it to the response folder:
npm test
-
Command to ignore changes to the "keys.js" file.
git update-index --assume-unchanged api/keys.js